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)
 Need to bind sps with GO

Author  Topic 

turbo
Starting Member

19 Posts

Posted - 2011-06-21 : 03:01:30
HI,
i have 200 set of Stored Procedures . i need to bind them into one file with "GO" between two files , since i have a drop/create script at the start of each SP.
Apart from generate scripts from MSSQL.
Is ter any other way u have come across.

Thanks in Advance.

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2011-06-21 : 09:22:18
You could loop through every proc in sys.procedures and execute sp_helptext with the output to file. And you could execute it from a SQL Agent job if it needs to be done frequently.
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2011-06-21 : 09:29:57
There's also:

SELECT OBJECT_DEFINITION(object_id) + N'
GO
' FROM sys.procedures
Go to Top of Page
   

- Advertisement -