To seach a string in the entire database

  • I am looking for a script that i can provide to a user so that he can search for a string the word "alert" in the entire database ( i.e all the tables)

    Please let me know if there is a way to do this without creating a stored procedure

    thanks

  • Full text search will work. But you have to create a full text index first.

    http://msdn.microsoft.com/en-us/library/ms142547.aspx

  • provide to a user ?!?! every varchar/char/nvarchar/nchar column in the database?

    unless this is for a developer to fix some code, as already suggested, you really need to use full text search, and identify the specific columns you want to search for 'alert'; the knee jerk "search everything" will cause bad things to happen. very bad things.

    there's a thread on the subject to search every/column/table in the database , but it each example uses a huge amount of resources....on production, it took me over 4 minutes to scan every table for the word 'TEST'; that's not an end user tool.

    http://qa.sqlservercentral.com/Forums/Topic947537-338-1.aspx

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply