Text find in sql server 2005

Posted on 2012-08-12
Last Modified: 2012-10-11

I would like to find a specific string  in all tables,stored procedures,triggers within same database.

Thanks in Advance
Question by:ksd123
    LVL 37

    Expert Comment

    what do you mean by find a string in the stored procedure? in the actual source code?
    try to look at this table

    as for checking all the columns of all the tables, you will have to create a script that does it by querying information _schema.columns and assemble the proper sql statements
    LVL 25

    Expert Comment

    you can use syscomments as well.
    LVL 9

    Expert Comment

    SELECT sm.object_id, OBJECT_NAME(sm.object_id) AS object_name, o.type,
        o.type_desc, sm.definition
    FROM sys.sql_modules AS sm
    JOIN sys.objects AS o ON sm.object_id = o.object_id
    where sm.definition like '%search_Criteria%'

    this is not run for the object created with ENCRYPTION .
    LVL 69

    Expert Comment

    by:Éric Moreau
    LVL 9

    Accepted Solution


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Suggested Solutions

    When writing XML code a very difficult part is when we like to remove all the elements or attributes from the XML that have no data. I would like to share a set of recursive MSSQL stored procedures that I have made to remove those elements from …
    INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now