Adjust schema

This commit is contained in:
Hector Cortez
2011-01-27 20:20:48 +00:00
parent 39fd37343f
commit 9cb5bf6e26

View File

@@ -309,7 +309,7 @@ CREATE TABLE [AUTHENTICATION_SOURCE]
IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'USERS') IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'USERS')
BEGIN BEGIN
DECLARE @reftable_5 nvarchar(60), @constraintname_5 nvarchar(60) DECLARE @reftable_8 nvarchar(60), @constraintname_8 nvarchar(60)
DECLARE refcursor CURSOR FOR DECLARE refcursor CURSOR FOR
select reftables.name tablename, cons.name constraintname select reftables.name tablename, cons.name constraintname
from sysobjects tables, from sysobjects tables,
@@ -321,11 +321,11 @@ BEGIN
and reftables.id = ref.fkeyid and reftables.id = ref.fkeyid
and tables.name = 'USERS' and tables.name = 'USERS'
OPEN refcursor OPEN refcursor
FETCH NEXT from refcursor into @reftable_5, @constraintname_5 FETCH NEXT from refcursor into @reftable_8, @constraintname_8
while @@FETCH_STATUS = 0 while @@FETCH_STATUS = 0
BEGIN BEGIN
exec ('alter table '+@reftable_5+' drop constraint '+@constraintname_5) exec ('alter table '+@reftable_8+' drop constraint '+@constraintname_8)
FETCH NEXT from refcursor into @reftable_5, @constraintname_5 FETCH NEXT from refcursor into @reftable_8, @constraintname_8
END END
CLOSE refcursor CLOSE refcursor
DEALLOCATE refcursor DEALLOCATE refcursor