Column unsage in a DB

  • All,

    I was wondering if there is a way that I could find out if a column is being by used by any of the stored procedures in a given database..

    So basically the script should scan through each and every SP for a given column and list all the SP's that was using that column....

  • Besides a script, you can use the excellent SQL Search Tool from RedGate (It's Free 🙂 )

    Other than that, you can use this simple query:

    SELECT

    ROUTINE_NAME,

    ROUTINE_DEFINITION

    FROM

    INFORMATION_SCHEMA.ROUTINES

    WHERE

    ROUTINE_DEFINITION LIKE '%YourTextToFind%'

    AND ROUTINE_TYPE='PROCEDURE'

    _______________________________________________________________________
    For better assistance in answering your questions, click here[/url]

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

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