Browse by Tags

All Tags » script (RSS)

Script out Procedures to seperate files

In this post script-out-procedures-and-functions-part-2 , I showed how to script out the procedures in a single file Here is another way to do the same but different file for each procedure. The file name will be the name of the procedure. declare @sps...

How to Generate Script along with Data?

One of the new features available in SQL Server 2008 is scripting the tables along with data (in the form of INSERT statements). Here are the useful links that can help you generating script with data SQL Server 2008 http://www.kodyaz.com/articles/sql...
Posted by Madhivanan | 2 comment(s)
Filed under: , ,

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 | 6 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...