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_PA_DISPLAYCOLS') and o.name = 'FK_PA_PAYPERSONPLAN_DISPLAYCOLS')
alter table T_PA_DISPLAYCOLS
drop constraint FK_PA_PAYPERSONPLAN_DISPLAYCOLS
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_PA_EXERULE') and o.name = 'FK_PA_PAYPERSONPLAN_EXERULE')
alter table T_PA_EXERULE
drop constraint FK_PA_PAYPERSONPLAN_EXERULE
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_PA_PAYPERSONPLAN_L') and o.name = 'FK_PA_PAYPERSONPLAN_L')
alter table T_PA_PAYPERSONPLAN_L
drop constraint FK_PA_PAYPERSONPLAN_L
go
if exists (select 1
from sysindexes
where id = object_id('T_PA_PAYPERSONPLAN')
and name = 'IDX_PA_PAYPERSONPLAN'
and indid > 0
and indid < 255)
drop index T_PA_PAYPERSONPLAN.IDX_PA_PAYPERSONPLAN
go
if exists (select 1
from sysobjects
where id = object_id('T_PA_PAYPERSONPLAN')
and type = 'U')
drop table T_PA_PAYPERSONPLAN
go
/*==============================================================*/
/* Table: T_PA_PAYPERSONPLAN */
/*==============================================================*/
create table T_PA_PAYPERSONPLAN (
FID int not null default 0,
FMASTERID int null default 0,
FNUMBER nvarchar(30) null,
FISENABLE char(1) null default '0',
constraint PK_T_PA_PAYPERSONPLAN primary key (FID)
)
go
/*==============================================================*/
/* Index: IDX_PA_PAYPERSONPLAN */
/*==============================================================*/
create index IDX_PA_PAYPERSONPLAN on T_PA_PAYPERSONPLAN (
FNUMBER ASC
)
go
|