📄 sms.txt
字号:
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('TB_EMPLOYEE') and o.name = 'FK_TB_EMPLO_RELATIONS_TB_EMPLO')
alter table TB_EMPLOYEE
drop constraint FK_TB_EMPLO_RELATIONS_TB_EMPLO
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('TB_GOODS') and o.name = 'FK_TB_GOODS_RELATIONS_TB_GOODS')
alter table TB_GOODS
drop constraint FK_TB_GOODS_RELATIONS_TB_GOODS
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('TB_SALE_GOODS') and o.name = 'FK_TB_SALE__RELATIONS_TB_GOODS')
alter table TB_SALE_GOODS
drop constraint FK_TB_SALE__RELATIONS_TB_GOODS
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('TB_SALE_GOODS') and o.name = 'FK_TB_SALE__RELATIONS_TB_SALE_')
alter table TB_SALE_GOODS
drop constraint FK_TB_SALE__RELATIONS_TB_SALE_
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('TB_SALE_SHEET') and o.name = 'FK_TB_SALE__RELATIONS_TB_EMPLO')
alter table TB_SALE_SHEET
drop constraint FK_TB_SALE__RELATIONS_TB_EMPLO
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('TB_STOCK_GOODS') and o.name = 'FK_TB_STOCK_RELATIONS_TB_STOCK')
alter table TB_STOCK_GOODS
drop constraint FK_TB_STOCK_RELATIONS_TB_STOCK
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('TB_STOCK_GOODS') and o.name = 'FK_TB_STOCK_RELATIONS_TB_GOODS')
alter table TB_STOCK_GOODS
drop constraint FK_TB_STOCK_RELATIONS_TB_GOODS
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('TB_STOCK_SHEET') and o.name = 'FK_TB_STOCK_RELATIONS_TB_PROVI')
alter table TB_STOCK_SHEET
drop constraint FK_TB_STOCK_RELATIONS_TB_PROVI
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('TB_STOCK_SHEET') and o.name = 'FK_TB_STOCK_RELATIONS_TB_EMPLO')
alter table TB_STOCK_SHEET
drop constraint FK_TB_STOCK_RELATIONS_TB_EMPLO
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('TB_STORAGE') and o.name = 'FK_TB_STORA_RELATIONS_TB_GOODS')
alter table TB_STORAGE
drop constraint FK_TB_STORA_RELATIONS_TB_GOODS
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('TB_SUPPLY') and o.name = 'FK_TB_SUPPL_RELATIONS_TB_PROVI')
alter table TB_SUPPLY
drop constraint FK_TB_SUPPL_RELATIONS_TB_PROVI
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('TB_SUPPLY') and o.name = 'FK_TB_SUPPL_RELATIONS_TB_GOODS')
alter table TB_SUPPLY
drop constraint FK_TB_SUPPL_RELATIONS_TB_GOODS
go
if exists (select 1
from sysindexes
where id = object_id('TB_EMPLOYEE')
and name = 'Relationship_8_FK'
and indid > 0
and indid < 255)
drop index TB_EMPLOYEE.Relationship_8_FK
go
if exists (select 1
from sysobjects
where id = object_id('TB_EMPLOYEE')
and type = 'U')
drop table TB_EMPLOYEE
go
if exists (select 1
from sysobjects
where id = object_id('TB_EMPLOYEE_TYPE')
and type = 'U')
drop table TB_EMPLOYEE_TYPE
go
if exists (select 1
from sysindexes
where id = object_id('TB_GOODS')
and name = 'Relationship_1_FK'
and indid > 0
and indid < 255)
drop index TB_GOODS.Relationship_1_FK
go
if exists (select 1
from sysobjects
where id = object_id('TB_GOODS')
and type = 'U')
drop table TB_GOODS
go
if exists (select 1
from sysobjects
where id = object_id('TB_GOODS_TYPE')
and type = 'U')
drop table TB_GOODS_TYPE
go
if exists (select 1
from sysobjects
where id = object_id('TB_MEMBER')
and type = 'U')
drop table TB_MEMBER
go
if exists (select 1
from sysobjects
where id = object_id('TB_PROVIDER')
and type = 'U')
drop table TB_PROVIDER
go
if exists (select 1
from sysindexes
where id = object_id('TB_SALE_GOODS')
and name = 'Relationship_9_FK'
and indid > 0
and indid < 255)
drop index TB_SALE_GOODS.Relationship_9_FK
go
if exists (select 1
from sysindexes
where id = object_id('TB_SALE_GOODS')
and name = 'Relationship_3_FK'
and indid > 0
and indid < 255)
drop index TB_SALE_GOODS.Relationship_3_FK
go
if exists (select 1
from sysobjects
where id = object_id('TB_SALE_GOODS')
and type = 'U')
drop table TB_SALE_GOODS
go
if exists (select 1
from sysindexes
where id = object_id('TB_SALE_SHEET')
and name = 'Relationship_7_FK'
and indid > 0
and indid < 255)
drop index TB_SALE_SHEET.Relationship_7_FK
go
if exists (select 1
from sysobjects
where id = object_id('TB_SALE_SHEET')
and type = 'U')
drop table TB_SALE_SHEET
go
if exists (select 1
from sysindexes
where id = object_id('TB_STOCK_GOODS')
and name = 'Relationship_10_FK'
and indid > 0
and indid < 255)
drop index TB_STOCK_GOODS.Relationship_10_FK
go
if exists (select 1
from sysindexes
where id = object_id('TB_STOCK_GOODS')
and name = 'Relationship_4_FK'
and indid > 0
and indid < 255)
drop index TB_STOCK_GOODS.Relationship_4_FK
go
if exists (select 1
from sysobjects
where id = object_id('TB_STOCK_GOODS')
and type = 'U')
drop table TB_STOCK_GOODS
go
if exists (select 1
from sysindexes
where id = object_id('TB_STOCK_SHEET')
and name = 'Relationship_6_FK'
and indid > 0
and indid < 255)
drop index TB_STOCK_SHEET.Relationship_6_FK
go
if exists (select 1
from sysindexes
where id = object_id('TB_STOCK_SHEET')
and name = 'Relationship_5_FK'
and indid > 0
and indid < 255)
drop index TB_STOCK_SHEET.Relationship_5_FK
go
if exists (select 1
from sysobjects
where id = object_id('TB_STOCK_SHEET')
and type = 'U')
drop table TB_STOCK_SHEET
go
if exists (select 1
from sysindexes
where id = object_id('TB_STORAGE')
and name = 'Relationship_2_FK'
and indid > 0
and indid < 255)
drop index TB_STORAGE.Relationship_2_FK
go
if exists (select 1
from sysobjects
where id = object_id('TB_STORAGE')
and type = 'U')
drop table TB_STORAGE
go
if exists (select 1
from sysindexes
where id = object_id('TB_SUPPLY')
and name = 'Relationship_12_FK'
and indid > 0
and indid < 255)
drop index TB_SUPPLY.Relationship_12_FK
go
if exists (select 1
from sysindexes
where id = object_id('TB_SUPPLY')
and name = 'Relationship_11_FK'
and indid > 0
and indid < 255)
drop index TB_SUPPLY.Relationship_11_FK
go
if exists (select 1
from sysobjects
where id = object_id('TB_SUPPLY')
and type = 'U')
drop table TB_SUPPLY
go
/*==============================================================*/
/* Table: TB_EMPLOYEE */
/*==============================================================*/
create table TB_EMPLOYEE (
empId varchar(15) not null,
emtId varchar(15) null,
empName varchar(10) not null,
empPass varchar(8) not null,
empState bit not null,
constraint PK_TB_EMPLOYEE primary key nonclustered (empId)
)
go
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -