all groups > sql server programming > february 2004 >
You're in the

sql server programming

group:

How do I retrieve Stored procedure code from SQL Server?


How do I retrieve Stored procedure code from SQL Server? HassanH
2/16/2004 10:56:05 PM
sql server programming:
Hi,
I need to pull the SP code from MS SQL Server 2000. Can any body tell me which system table contains this code ? is it encrypted?

Thanks,
Hassan H.
Re: How do I retrieve Stored procedure code from SQL Server? Roji. P. Thomas
2/17/2004 12:36:12 PM
sp_helptext 'usp_urspname'

--
Roji. P. Thomas
SQL Server Programmer
[quoted text, click to view]

Re: How do I retrieve Stored procedure code from SQL Server? Vishal Parkar
2/17/2004 1:03:33 PM
hi HassanH,

[quoted text, click to view]
table contains this code ? is it encrypted?

basically stored procedure text is stored in system tables called "syscomments". this table
stores text of a rule, a default, or an unencrypted stored procedure, user-defined function,
trigger, or view. No need to refer to this table (Microsoft recommends not to query system
tables directly.The structure of these table may change from version to version, instead use
system stored procedures/information_schema views.). you can use system stored procedure
called "sp_helptext" to view the text of a stored procedure (non encrypted stored
procedures).

The stored procedures which are not encrypted will be visible to you.

You have also an option to script stored procedure using enterprise manager.

Go to Enterprise manager.
Right click on the database. click on "all tasks" . click on "generate sql script". click on
"show all", click on "all stored procedures". Select/deselect the objects you wish to script.
this will generate a script file with DDL commands for stored procedure.

--
Vishal Parkar
vgparkar@yahoo.co.in

AddThis Social Bookmark Button