Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Print all system stored procedures and function

Author  Topic 

Sun Foster
Aged Yak Warrior

515 Posts

Posted - 2007-03-09 : 11:06:45
Is there a way to print all system stored procedures and functions?

snSQL
Master Smack Fu Yak Hacker

1837 Posts

Posted - 2007-03-09 : 13:11:11
Run this with results to text, then copy the results and execute in master to get the text (Over 150,000 lines of code)
select 'exec sp_helptext ' + [name] from master..sysobjects 
where type in ('P', 'FN') and uid <> 4
Go to Top of Page

Sun Foster
Aged Yak Warrior

515 Posts

Posted - 2007-03-09 : 16:49:26
I tried it but did not work
Go to Top of Page

Sun Foster
Aged Yak Warrior

515 Posts

Posted - 2007-03-09 : 16:50:18
after first run,

exec sp_helptext sp_MSrepl_startup
exec sp_helptext sp_MScleanupmergepublisher
Go to Top of Page

snSQL
Master Smack Fu Yak Hacker

1837 Posts

Posted - 2007-03-09 : 17:44:44
Sorry, that was for 2000, for 2005, remove the uid from the where clause. So this
select 'exec sp_helptext ' + [name] from master..sysobjects 
where type in ('P', 'FN')
Go to Top of Page

Sun Foster
Aged Yak Warrior

515 Posts

Posted - 2007-03-14 : 15:24:19
This is working fine.
Thanks!
Go to Top of Page
   

- Advertisement -