Template Script: Misc\Recreate Table Index.sql

SET NOCOUNT ON
select 'drop index ' + NAME + '.MORTGAGE.MTG_DOC_DT_NBR_KEY;' from sys.schemas where name like 'gr[0-9][0-9]'

select 'ALTER TABLE ' + NAME + '.MORTGAGE DROP CONSTRAINT MTG_DOC_DT_NBR_KEY;' from sys.schemas where name like 'gr[0-9][0-9]'

exec  [dbo].[usp_CreateTable]
     @CntyCd = '',
     @SchemaName = 'gr01',
     @TableName ='MORTGAGE',
     @IncludeColumns = 0,
     @IncludeConstraints = 0,
     @IncludeIndexes = 1,
     @NewSchemaName ='GR01',
     @NewTableName = 'TEMP_MORTGAGE',
     @DropIfExists = 0,
     @ExecuteScript = 0,
      @sql = '' ,
     @trace = 1
go
exec  [dbo].[usp_CreateTable]
     @CntyCd = '',
     @SchemaName = 'gr12',
     @TableName ='MORTGAGE',
     @IncludeColumns = 0,
     @IncludeConstraints = 0,
     @IncludeIndexes = 1,
     @NewSchemaName ='gr12',
     @NewTableName = 'TEMP_MORTGAGE',
     @DropIfExists = 0,
     @ExecuteScript = 0,
      @sql = '' ,
     @trace = 1
go
exec  [dbo].[usp_CreateTable]
     @CntyCd = '',
     @SchemaName = 'gr21',
     @TableName ='MORTGAGE',
     @IncludeColumns = 0,
     @IncludeConstraints = 0,
     @IncludeIndexes = 1,
     @NewSchemaName ='gr21',
     @NewTableName = 'TEMP_MORTGAGE',
     @DropIfExists = 0,
     @ExecuteScript = 0,
      @sql = '' ,
     @trace = 1
go
exec  [dbo].[usp_CreateTable]
     @CntyCd = '',
     @SchemaName = 'gr35',
     @TableName ='MORTGAGE',
     @IncludeColumns = 0,
     @IncludeConstraints = 0,
     @IncludeIndexes = 1,
     @NewSchemaName ='gr35',
     @NewTableName = 'TEMP_MORTGAGE',
     @DropIfExists = 0,
     @ExecuteScript = 0,
      @sql = '' ,
     @trace = 1
go
exec  [dbo].[usp_CreateTable]
     @CntyCd = '',
     @SchemaName = 'gr45',
     @TableName ='MORTGAGE',
     @IncludeColumns = 0,
     @IncludeConstraints = 0,
     @IncludeIndexes = 1,
     @NewSchemaName ='gr45',
     @NewTableName = 'TEMP_MORTGAGE',
     @DropIfExists = 0,
     @ExecuteScript = 0,
      @sql = '' ,
     @trace = 1
go

Description for Template Script: Misc\Recreate Table Index.sql

Todo
Site Map | Printable View | © 2008 - 2012 NuRoN Consulting, INC | Powered by mojoPortal | HTML 5 | CSS | Original design by Andreas Viklund
Share This Using Popular Bookmarking Services