`

Search for a stored procedure

阅读更多

September 3, 2007 by Pinal Dave
SQL SERVER – 2005 – Search Stored Procedure Code – Search Stored Procedure Text

I receive following question many times by my team members.

How can I find if particular table is being used in the stored procedure?
How to search in stored procedures?
How can I do dependency check for objects in stored procedure without using sp_depends?

I have previously wrote article about this SQL SERVER – Find Stored Procedure Related to Table in Database – Search in All Stored procedure.

The same feature can be implemented using following script in SQL Server 2005.
USE AdventureWorks
GO
--Searching for Empoloyee table
SELECT Name
FROM sys.procedures
WHERE OBJECT_DEFINITION(OBJECT_ID) LIKE '%Employee%'
GO
--Searching for Empoloyee table and RateChangeDate column together
SELECT Name
FROM sys.procedures
WHERE OBJECT_DEFINITION(OBJECT_ID) LIKE '%Employee%'
AND OBJECT_DEFINITION(OBJECT_ID) LIKE '%RateChangeDate%'
GO
ResultSet:
Name
———————————–
uspGetEmployeeManagers
uspGetManagerEmployees
uspUpdateEmployeeHireInfo
uspUpdateEmployeeLogin
uspUpdateEmployeePersonalInfo

Name
———————————–
uspUpdateEmployeeHireInfo

Reference : Pinal Dave (http://blog.SQLAuthority.com)
分享到:
评论

相关推荐

    IBO v5.3.3 Build 1955(January 2, 2014) Full Source

    I added the PostEvent() method to the TIB_Connection component to post an event without having to create a stored procedure or use an EXECUTE BLOCK statement. This is done via BLR. I totally reworked...

    微软内部资料-SQL性能优化5

    Just as the organization of a telephone directory makes it easy for a person to search, SQL Server quickly searches a table with a clustered index. Because a clustered index determines the sequence ...

    微软内部资料-SQL性能优化3

    For example, suppose a transaction scanned a page using an S lock and then subsequently decided to perform a row level update. The row would obtain an X lock, but now the page would require an IX ...

    Sakemail

    The side effect for this is that YOUR app must check if the host is a host name or a IP address, in my app I remove the periods and try to convert the result to a float (long integers don‘t work, ...

    opengoo 1.3 RC1

    - bugfix: search in a workspace returned no results but search in all workspaces returned results from that workspace. - bugfix: Total task execution time report included task pause time as well as ...

    Inside Microsoft SQL Server 2000

    Other Search Expressions . Summary 8. Indexes [加入我的離線書架] . Index Organization . Creating an Index . The Structure of Index Pages . Index Space Requirements . Managing an Index . ...

    FlexGraphics_V_1.79_D4-XE10.2_Downloadly.ir

    - FIX: In BCB a problem occurred with TFlexText.DrawText, which for some reason kept being renamed by linker to DrawTextA. For BCB the method was renamed to DrawTextCPP. - FIX: Problems grouping ...

    xyplorer_full.zip

    powerful file search, a versatile preview, a highly customizable interface, optional dual pane, and a large array of unique ways to efficiently automate frequently recurring tasks. It抯 fast, ...

    ICS delphixe10源码版

    ICS V7 is a stable release that may still be updated for major bugs, but not for new releases of Delphi, latest it supported was XE3. ICS V8 is the current development release which is held in a ...

    曲线拟合工具CurveExpert 1.0

    + A separate set of application-wide defaults are maintained for the single-precision and double-precision versions (registered version only) Bug Fixes: + Periods by themselves in the user ...

    occam一维反演

    C AS THE ARRAY SIZES FOR THE 2D PROBLEM ARE NOW GETTING TOO LARGE FOR COMFORT. C INCLUDE FILES ARE NOW USED TO STREAMLINE CHANGES OF DIMENSION. C IMPLICIT DOUBLE PRECISION HAS BEEN REMOVED, AGAIN FOR ...

    网上图书销售数据库+ASP

    ' ADO constants include file for VBScript ' '-------------------------------------------------------------------- '---- CursorTypeEnum Values ---- Const adOpenForwardOnly = 0 Const adOpenKeyset = 1 ...

Global site tag (gtag.js) - Google Analytics