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
 General SQL Server Forums
 New to SQL Server Programming
 creating script to view all procedures in a db

Author  Topic 

aclol
Starting Member

4 Posts

Posted - 2009-05-15 : 12:32:22
I'm trying to look at stored procedures in a database to make sure there are no crossserver or cross database joins so we can upgrade to SQL Server 2005 from SQL 2000

Can anyone tell me a script i could use to see all procedure scripts at once?

Or do you have any other idea?

Thanks

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-05-15 : 12:42:21
[code]SELECT ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_TYPE='PROCEDURE'[/code]
Go to Top of Page

aclol
Starting Member

4 Posts

Posted - 2009-05-15 : 12:52:25
thank you so much!

Worked perfectly
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-05-15 : 13:09:13
welcome
Go to Top of Page

aclol
Starting Member

4 Posts

Posted - 2009-05-15 : 13:23:14
Sorry, I just realized that the script you gave isn't showing the actually definition of the procedures.(only title and vars are showing)
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-05-15 : 14:18:28
why? are you viewing results in text or grid?try using grid option
Go to Top of Page

aclol
Starting Member

4 Posts

Posted - 2009-05-15 : 15:29:13
thanks, i found a fix, highlighted all the procedures and clicked generate script

Thanks for you help though, i appreciate it..
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-05-16 : 02:29:26
Also refer
http://sqlblogcasts.com/blogs/madhivanan/archive/2007/12/13/script-out-procedures-and-functions-part-2.aspx

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -