in

SQL Server Community Blogs

Voices of the SQL Server Community

Browse by Tags

  • 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 table scripts ( sps varchar ( 8000 )) declare @texts...
    Posted to Madhivanan (Weblog) by Madhivanan on 12-13-2007
  • 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(100) declare @cols table (datatype varchar...
    Posted to Madhivanan (Weblog) by Madhivanan on 08-27-2007
  • 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.sql" -c' After it runs successfully, the file...
    Posted to Madhivanan (Weblog) by Madhivanan on 08-27-2007
Page 1 of 1 (3 items)
Powered by Community Server (Commercial Edition), by Telligent Systems