How to find String in All Stored Procedures in SQL Server Database

We often have the situations where we want to find string in all the stored procedures in a database. Some of the situations are listed below

  • Find out how many stored procedure are using Cross Database Queries, so we want to search for Database name in all the stored procedures in a database.
  • Find out in how many stored procedure a table/view is used in a Database? This can be situation where we are planning to change the name of table/view and want to make sure if any Stored Procedure/s will be effected.
  • Find out a column name used in Stored Procedure/s in SQL Server Database.
  • Find out some comments in all the Stored Procedure to see who created those Stored Procedure, if Creator name is used in the comments.
and there could be more situations. SQL Server provide us system tables and views those store information and definition of objects for us so we can get information related to the objects such as tables,views,Stored Procedures,Triggers,Functions etc.

System.sql_modules and sys.syscomments system views can be used to dig into the definition of objects and search if any other object is used in the definition or not. Let's suppose if I am looking for comments in objects Creator Name=Aamir. I can use both system views to find out required information by using below queries.

definition             AS ObjectDefinition
 FROM   sys.sql_modules 
WHERE  definition LIKE '%Creator Name=Aamir%'

TEXT AS ObjectDefinition 
FROM   sys.syscomments 
WHERE  TEXT LIKE '%Creator Name=Aamir%' 

Fig 1: Search String in all Stored Procedures in SQL Server Database


  1. I enjoyed reading your article. Please make more interesting topics like this on.
    I'll come back for more :)

    From Japs a researcher from AOC, a company whois into ecommerce website design Sydney

  2. Even when you are looking at inexpensive materials, an L-shaped desk is still an investment! It is crucial that the desk you choose fits your needs and be able to provide you with the storage as well as workspace necessary to carry out your goals.

  3. replica watches uk, combining elegant style and cutting-edge technology, a variety of styles of replica cartier watches, the pointer walks between your exclusive taste style.

  4. This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free. find out more

  5. Well, that’s the first time on your blog but I really like your post.

    I have my own blog where I post about E Scooter App Development and much more take a look.

  6. Beauty is one's ability to generate light through character. Light requires energy. Energy requires movement. Character implies self confidence and self esteem. Character also implies wisdom gained through experience. Beauty is, therefore, character in motion. Ecommerce savona

  7. I have bookmarked your website because this site contains valuable information in it. I am really happy with articles quality and presentation. Thanks a lot for keeping great stuff. I am very much thankful for this site. Ecommerce Liguria

  8. This is actually the kind of information I have been trying to find. Thank you for writing this information. buy 500 instagram likes uk

  9. This is a wonderful article, Given so much info in it, These type of articles keeps the users interest in the website, and keep on sharing more ... good luck. subtle signs he's not into you..ruhul Amin

  10. This comment has been removed by the author.

  11. This comment has been removed by the author.

  12. I truly welcome the sort of points you post here. A debt of gratitude is in order for sharing us an incredible data that is really useful. Great day!

  13. This is my first time visit to your blog and I am very interested in the articles that you serve. Provide enough knowledge for me. Thank you for sharing useful and don't forget, keep sharing useful info: shopify dropshipping websites for sale

  14. Clinique de haut standing pluridisciplinaire qui dispose de toutes les spécialités médico-chirurgicales et d'un plateau technique de pointe conforme aux normes du Ministère de la Santé Publique.
    Votre chirurgie esthétique bariatrique orthopedique en tunisie, information des types de chirurgies, le voyage et les séjour.
    Chirurgie esthétique, de l'obésité, proctologique, orthopédique en traumatologique en Tunisie avec Tunisie Esthetic.

  15. I’m glad to find another amazing app development blogger.
    online meal kit delivery services

  16. That is amazing very good Thank you so much for sharing this post. สมัคร joker slot

  17. This is an amazing Blog and very informative and useful Thanks.

  18. I really appreciate the kind of topics you post here. Thanks for sharing us a great information that is actually helpful.
    ทางเข้าเล่น 123BETTING

  19. Great Article it its really informative and innovative keep us posted with new updates. its was really valuable. thanks a lot.
    create taxi app

  20. Never though of being an grateful and nice way to conclude all the managing point according to the clients.
    Sarojini Nagar Market Near Me Girls Delhi
    News 18 Mumbai High Profile Girls

  21. It is indeed true that this article is a source of good knowledge for me! I completely appreciated this article, it is very helpful and important for everyone. Thank you heartily for giving your best.
    Sex Dating Delight
    jalebi bai web series
    indian sex photos
    Online Dating Service
    Write for us
    ullu web series name list
    Gaon Ki garmi Ullu Web Series
    Increase Sex Stamina