if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('T_ATS_ATTENDGROUPPERSON') and o.name = 'FK_ATS_ATTENDGROUPPERSON')
alter table T_ATS_ATTENDGROUPPERSON
drop constraint FK_ATS_ATTENDGROUPPERSON
go
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('T_ATS_ATTENDGROUPPERSON_L') and o.name = 'FK_T_ATS_AT_FK_ATS_AT_T_ATS_AT')
alter table T_ATS_ATTENDGROUPPERSON_L
drop constraint FK_T_ATS_AT_FK_ATS_AT_T_ATS_AT
go
if exists (select 1
from sysindexes
where id = object_id('T_ATS_ATTENDGROUPPERSON')
and name = 'IDX_ATS_AGPERSON_FID'
and indid > 0
and indid < 255)
drop index T_ATS_ATTENDGROUPPERSON.IDX_ATS_AGPERSON_FID
go
if exists (select 1
from sysobjects
where id = object_id('T_ATS_ATTENDGROUPPERSON')
and type = 'U')
drop table T_ATS_ATTENDGROUPPERSON
go
/*==============================================================*/
/* Table: T_ATS_ATTENDGROUPPERSON */
/*==============================================================*/
create table T_ATS_ATTENDGROUPPERSON (
FENTRYID int not null default 0,
FSEQ int null,
FID int null,
FGROUPID int null,
constraint PK_T_ATS_ATTENDGROUPPERSON primary key (FENTRYID)
)
go
/*==============================================================*/
/* Index: IDX_ATS_AGPERSON_FID */
/*==============================================================*/
create index IDX_ATS_AGPERSON_FID on T_ATS_ATTENDGROUPPERSON (
FID ASC
)
go
alter table T_ATS_ATTENDGROUPPERSON
add constraint FK_ATS_ATTENDGROUPPERSON foreign key (FID)
references T_ATS_ATTENDPERSON (FID)
go
|