--删除数据库中的所有外键约束
declare @s varchar(8000)
declare tb cursor local for
select s='alter table ['+object_name(parent_obj)+'] drop constraint ['+name+']'
from sysobjects where xtype='F'
open tb
fetch next from tb into @s
while @@fetch_status=0
begin
exec(@s)
fetch next from tb into @s
end
close tb
deallocate tb
260.删除数据库中的所有外键约束
最新推荐文章于 2023-11-07 17:12:51 发布