Friday, February 24, 2012

Obtain contents of stored procedures

Hi all,

I need to be able to obtain the full contents, i.e. sql statements
inside, of all procedures in SQl Server 2000. I am using MS type 4
JDBC driver. I know that from the database metadata, I could get the
names of all stored procedures and their column structures. However,
I did not find any thing that will help me to obtain contents of the
stored procedures. Any help would be very much appreciated. Thanks
:-)) Vien NguyenFor a single stored procedure you can use:

EXEC sp_helptext 'sp'

The code is stored in the text column of a system table called syscomments.
You can query this table directly (though not always recommended) or you can
use INFORMATION_SCHEMA.ROUTINES view. See SQL Server Books Online for more
details.

--
- Anith
( Please reply to newsgroups only )

No comments:

Post a Comment