Template Script: Schema\Drop objects belonging to Schema and schema.sql

-- USE UTIL
USE <DBName>

DECLARE @SQL VARCHAR(MAX)
SELECT  @SQL = Util.dbo.StringConcat(dropscript, ';
'
)
FROM    (SELECT TOP 999999
                dropscript
         FROM   Metadata.ProcedureScripts
         WHERE  schemaname IN ('TransactionLoad', 'PropertyLoad', 'LoadCodeTables', 'LoadProperty', 'LoadBuilding', 'LoadFlagFiles', 'ExtractTemplate',
                               'BuildingLoad', 'LoadTransaction', 'LoadSubdivision')
         ORDER BY CASE WHEN TYPE = 'SCHEMA' THEN 1
                       ELSE 0
                  END) K

IF @SQL <> ''
    EXEC(@SQL)

Description for Template Script: Schema\Drop objects belonging to Schema and schema.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