Compare Page Revisions
« Older Revision - Back to Page History - Current Revision
select sequence = 1 ,name = foreignKey.name ,sql = 'ALTER TABLE [' + s.name + '].[' + onTable.name + '] drop constraint [' + foreignKey.name + ']' from sysforeignkeys fk inner join sysobjects foreignKey on foreignKey.id = fk.constid inner join sysobjects onTable on fk.fkeyid = onTable.id inner join sysusers s on onTable.uid = s.uid where 1=1 and onTable.type = 'U' -- and onTable.is_ms_shipped = 0 and onTable.name not like 'sys%' union select sequence = 2 ,name = o.name ,sql = 'DROP ' + case o.type when 'FN' then 'FUNCTION' when 'IF' then 'FUNCTION' when 'P' then 'PROCEDURE' when 'TF' then 'FUNCTION' when 'U' then 'TABLE' when 'V' then 'VIEW' end + ' [' + s.name + '].[' + o.name + ']' from sysobjects o inner join sysusers s on o.uid = s.uid where 1=1 and type in ('FN','IF','P','TF','U','V') -- and is_ms_shipped = 0 and o.name not like 'sys%' union select sequence = 3 ,name = '' ,sql = 'select * from sysobjects' order by sequence ,name
ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2024, Patrick Jasinski.