Search for String in all columns

  • Comments posted to this topic are about the item Search for String in all columns

    Wes
    (A solid design is always preferable to a creative workaround)

  • This could prove very useful -- thank you 🙂

  • Glad to hear it.

    I've already made a few minor revisions to it that I'll try to post a bit later when I have some time.

    Wes

    Wes
    (A solid design is always preferable to a creative workaround)

  • --*********************************

    --Show progress on the message tab

    --*********************************

    PRINT @SQL

    PRINT 'Column ' + CAST(@LoopNo AS NVARCHAR(5)) + ': ' +@Schema + '.' + @Table + '.' + @Column + ' @ ' + CONVERT(VARCHAR(12),CURRENT_TIMESTAMP,114)

    When trying to backport the code to SQL 2005, I messed up the progress message, causing it to show the date instead of the time. Replace the progress block with the lines pasted above. This does not affect the functionality of the code in any way. I just found it useful to know the time and duration a table was searched.

    Sample message tab output:

    SELECT [TechnologyName] FROM [dim].[Technology] where charINDEX('Approved',[TechnologyName]) > 0

    Column 3: dim.Technology.TechnologyName @ 16:08:56:573

    The message tab includes the select statement used for the search so you can copy it and run it manually if you need to.

    Wes
    (A solid design is always preferable to a creative workaround)

  • Thanks for the script.

Viewing 5 posts - 1 through 4 (of 4 total)

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