-
syscomments
Hi
can someone tell me how to use syscomments table.
The thing is, i need to find the text of a system stored procedure but i am not sure what condition to use in the query.
sp_helptext did help, but i wanted to use syscomments table.
thanks!!
-
Stored procedure text may be split into multiple lines in syscomments.
Get stored procedure object_id and query syscomments.
SQL 2005 has sys.sql_modules view which has all text in one row.
-
But if i need the text for a Stored Procedure in master database, say 'sp_addalias', i need to query sysobjects table to get the id for the stated Stored Procedure. and by using that id, i can query only syscomments table, not sys.sql_modules view, i guess.
sys.sql_modules view contains the stored procedure entries of msdb system databse only i think. and the object_id of those stored procedures can be taken from the view sys.objects system view.
pls correct me if i m wrong somewhere or if i am lacking knowledge somewhere!!!
thanks!!!
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|