Browse by Tags

All Tags » script (RSS)

Script out Procedures and Functions - Part 2

Part 1 uses information_Schema.routines view and this is based on sp_helptext declare @sps table ( texts varchar ( 8000 )) insert into @sps select 'sp_helptext ''' + name + '''' from sysobjects where xtype in ( 'p' , 'fn' ) order by xtype , name create...
Posted by Madhivanan | 3 comment(s)
Filed under: ,

Generate SQL Script

--This procedure will generate the structure of the table Create Procedure GenerateScript ( @tableName varchar(100)) as If exists (Select * from Information_Schema.COLUMNS where Table_Name= @tableName) Begin declare @sql varchar(8000) declare @table varchar...

Scripts Stored Procedures and Functions through query

This query will script the Procedures and Functions All you have to do is replace DBname by the actual Database Name exec master..xp_cmdshell 'bcp "Select routine_definition from DBname.information_Schema.routines order by routine_name" queryout "C:\scripts...