Guruji Point - Code You Want To Write

  • Home
  • Asp.Net
  • WCF
  • SQL
  • Type Script
  • AngularJS
  • Tech News
  • Blog
  • Earn Online

Sunday, 25 December 2016

Find All The StoredProcedures Containing A Text in SQL Server

 No comments   

Introduction

In this article i will explain about How to find all the Stored Procedures containing a specific Text. 

Practice

Here i am writing my Stored Procedure to find all the Stored Proceduresin database which contains that particular text .It may be field name or variable name.

To get all stored procedures which contains text in sql server we have different ways by using sql server system modules like syscomments or sys.sql_modules we can get all the stored procedures which contains particular text in sql query statements.

By using  sql_modules 


SELECT OBJECT_NAME(object_id)
FROM sys.sql_modules
WHERE OBJECTPROPERTY(object_id, 'IsProcedure') = 1
AND definition LIKE '%insupd%'


Here i searched "insupd"  text in all procedures in my database, you just need to change the name which  used in Like '%Your_Text%', and all the related SP will be displayed you in a sql query result window.  


By using system modules


SELECT OBJECT_NAME(id)
FROM SYSCOMMENTS
WHERE [text] LIKE '%insupd%'
AND OBJECTPROPERTY(id, 'IsProcedure') = 1
GROUP BY OBJECT_NAME(id)

  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Email ThisBlogThis!Share to XShare to Facebook
Newer Post Older Post Home

0 comments:

Post a Comment

Facebook Updates

Guruji Point

Categories

Comman table Expression in SQL Dynamic Grid Row IQueryable in c# Learn AngularJS Scope_Identity() Use of indexes comma seperated string in sql row_number() and dense_rank() salary table structure. while loop in sql why do we need cursor why tuple used

About Us

This blog is about the Programming ,Tech News and some intresting facts related Contents. Here you can find fundamental and expert level topic of programming languages very practically related to C# , Asp.Net ,Sql-Server, JavaScript, Jquery, WebServices And also Web-Api, WCF ,WPF, Angular Js.

Contact Us

Email Us - gurujipoints@gmail.com
Contact- 8077657477

Reach Us

Copyright © Guruji Point - Code You Want To Write