Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query all Stored Procedures

Status
Not open for further replies.
Apr 18, 2002
185
US
I am looking for a way to query all my stored procedures in a certain database to find out if the string "set transaction isolation level read uncommitted" has been put in them... does anyone have an easy way to do this?
 
I am a little confused as to what you are suggesting? Are you recommending I script out all the procedures before searching for that string inside the procedure?
 
Hi Steffi,

This works on my SQL 2000 server.

SELECT ROUTINE_NAME, ROUTINE_DEFINITION
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_DEFINITION LIKE '%"set transaction isolation level read uncommitted%'
AND ROUTINE_TYPE='PROCEDURE'

Hope this helps.
 
Late to the party, but:

Be careful with evaluating ROUTINE_DEFINITION. In your case, Steffi, it shouldn't be a problem because the SET statement should be at the beginning of the routine.

Routines larger than 8KB are split into records in the syscomments table. Take a look at for an explanation and a way to retrieve large SP text.

-------++NO CARRIER++-------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top