Find the stored procedure name or Table name in entire SQL Server

  • Hey,

    i need to search one stored procedure is located under which database .

    please any one help me giving the script.

  • Sree Divya (2/22/2016)


    Hey,

    i need to search one stored procedure is located under which database .

    please any one help me giving the script.

    Write a loop to step through the results of a Select from sys.Databases and execute a bit of dynamic SQL to check sys.objects for each database listed. I'd write one for you but you'll be able to support it better if you write your own.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • I'd just go over to Red-gate.com and get a copy of SQL Search[/url]. It's a free tool and will do pretty much any kind of search you need against your databases.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

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

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