Template Script: Partition\Drop Partitioned Tables.sql

SELECT  DISTINCT 'drop table ' + s.name + '.' + t.name + ';'
FROM    sys.schemas s (NOLOCK) INNER JOIN sys.tables t (NOLOCK) ON t.SCHEMA_ID = s.SCHEMA_ID
INNER JOIN sys.indexes i(NOLOCK) ON i.OBJECT_ID = t.OBJECT_ID
INNER JOIN sys.data_spaces d (NOLOCK) ON d.data_space_id = i.data_space_id
WHERE s.name NOT IN('ttrans', 'ttax')
AND s.name NOT LIKE 'ttax[0-9][0-9]'
AND d.type = 'ps'

Description for Template Script: Partition\Drop Partitioned Tables.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