📄 createsqlserver.sql
字号:
/* drop all constraint */
if exists (select * from sysobjects where id = object_id(N'[dbo].[FKDC4D3E4BC4AB08AA]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
alter table NBPM_ACTOR drop constraint FKDC4D3E4BC4AB08AA
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[FKDC9635503553D7E7]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
alter table NBPM_FIELD drop constraint FKDC9635503553D7E7
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[FK1BE14120B63DD9C0]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
alter table NBPM_MEMBERSHIP drop constraint FK1BE14120B63DD9C0
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[FK1BE141206A68DF4]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
alter table NBPM_MEMBERSHIP drop constraint FK1BE141206A68DF4
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[FKB1DE48450E681]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
alter table NBPM_PROCESSBLOCK drop constraint FKB1DE48450E681
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[FKB1DE483AE6A603]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
alter table NBPM_PROCESSBLOCK drop constraint FKB1DE483AE6A603
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[FKB1DE48B7C43122]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
alter table NBPM_PROCESSBLOCK drop constraint FKB1DE48B7C43122
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[FK46521BF2A061B05A]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
alter table NBPM_ATTRIBUTE drop constraint FK46521BF2A061B05A
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[FK46521BF2B7C43122]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
alter table NBPM_ATTRIBUTE drop constraint FK46521BF2B7C43122
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[FK46521BF26833E54]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
alter table NBPM_ATTRIBUTE drop constraint FK46521BF26833E54
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[FKAD5A74807E4E3BFE]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
alter table NBPM_ACTION drop constraint FKAD5A74807E4E3BFE
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[FK375F5193B7C43122]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
alter table NBPM_JOB drop constraint FK375F5193B7C43122
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[FK375F51937E4E3BFE]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
alter table NBPM_JOB drop constraint FK375F51937E4E3BFE
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[FK44FE944AB7C43122]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
alter table NBPM_ASSEMBLYFILE drop constraint FK44FE944AB7C43122
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[FKB48905F8C4AB08AA]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
alter table NBPM_FLOW drop constraint FKB48905F8C4AB08AA
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[FKB48905F8842C3824]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
alter table NBPM_FLOW drop constraint FKB48905F8842C3824
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[FKB48CB2CCAA96D113]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
alter table NBPM_NODE drop constraint FKB48CB2CCAA96D113
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[FKB48CB2CCDB870B8A]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
alter table NBPM_NODE drop constraint FKB48CB2CCDB870B8A
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[FKB48CB2CC953D700F]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
alter table NBPM_NODE drop constraint FKB48CB2CC953D700F
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[FKB48CB2CCDC6D79F2]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
alter table NBPM_NODE drop constraint FKB48CB2CCDC6D79F2
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[FKB48CB2CCB7C43122]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
alter table NBPM_NODE drop constraint FKB48CB2CCB7C43122
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[FKB48CB2CC16B99624]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
alter table NBPM_NODE drop constraint FKB48CB2CC16B99624
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[FKB48CB2CCBDC5B3D5]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
alter table NBPM_NODE drop constraint FKB48CB2CCBDC5B3D5
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[FKB48CB2CC7534635E]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
alter table NBPM_NODE drop constraint FKB48CB2CC7534635E
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[FKD617A9EBC7AA9C]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
alter table NBPM_LOGDETAIL drop constraint FKD617A9EBC7AA9C
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[FKD617A9EB32C59B]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
alter table NBPM_LOGDETAIL drop constraint FKD617A9EB32C59B
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[FKD617A9EB52D4AD28]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
alter table NBPM_LOGDETAIL drop constraint FKD617A9EB52D4AD28
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[FK375F591A30012E]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
alter table NBPM_LOG drop constraint FK375F591A30012E
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[FKBE986672B7C43122]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
alter table NBPM_DELEGATION drop constraint FKBE986672B7C43122
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[FKDC96355068AC491]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
alter table NBPM_FIELD drop constraint FKDC96355068AC491
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[FKDC963550C7AA9C]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
alter table NBPM_FIELD drop constraint FKDC963550C7AA9C
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[FK236E60DA2D1911C2]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
alter table NBPM_PROCESSINSTANCE drop constraint FK236E60DA2D1911C2
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[FK236E60DAB7C43122]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
alter table NBPM_PROCESSINSTANCE drop constraint FK236E60DAB7C43122
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[FK236E60DAF607B530]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
alter table NBPM_PROCESSINSTANCE drop constraint FK236E60DAF607B530
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[FK4FF269F1C144]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
alter table NBPM_TRANSITION drop constraint FK4FF269F1C144
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[FK4FF269FB7C43122]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
alter table NBPM_TRANSITION drop constraint FK4FF269FB7C43122
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[FK4FF269F5D2DDF5]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
alter table NBPM_TRANSITION drop constraint FK4FF269F5D2DDF5
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[FK84748E876833E54]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
alter table NBPM_ATTRIBUTEINSTANCE drop constraint FK84748E876833E54
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[FK84748E87C7AA9C]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
alter table NBPM_ATTRIBUTEINSTANCE drop constraint FK84748E87C7AA9C
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[FKB1DE48A1927D4F]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
alter table NBPM_PROCESSBLOCK drop constraint FKB1DE48A1927D4F
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[FKB1DE4866309C76]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
alter table NBPM_PROCESSBLOCK drop constraint FKB1DE4866309C76
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[FKB1DE48300CC2]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
alter table NBPM_PROCESSBLOCK drop constraint FKB1DE48300CC2
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[FKB1DE48609C875]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
alter table NBPM_PROCESSBLOCK drop constraint FKB1DE48609C875
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[FK375F519338B735AF]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
alter table NBPM_JOB drop constraint FK375F519338B735AF
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[FKB48905F833AE02]') and OBJECTPROPERTY(id, N'IsConstraint') = 1)
alter table NBPM_FLOW drop constraint FKB48905F833AE02
GO
/* drop all table */
if exists (select * from sysobjects where id = object_id(N'[dbo].[NBPM_ACTOR]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[NBPM_ACTOR]
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[NBPM_LOG]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[NBPM_LOG]
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[NBPM_DELEGATION]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[NBPM_DELEGATION]
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[NBPM_FIELD]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[NBPM_FIELD]
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[NBPM_PROCESSINSTANCE]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[NBPM_PROCESSINSTANCE]
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[NBPM_TRANSITION]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[NBPM_TRANSITION]
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[NBPM_ATTRIBUTEINSTANCE]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[NBPM_ATTRIBUTEINSTANCE]
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[NBPM_MEMBERSHIP]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[NBPM_MEMBERSHIP]
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[NBPM_PROCESSBLOCK]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[NBPM_PROCESSBLOCK]
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[NBPM_ATTRIBUTE]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[NBPM_ATTRIBUTE]
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[NBPM_ACTION]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[NBPM_ACTION]
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[NBPM_JOB]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[NBPM_JOB]
GO
/* old version never created in the new version*/
if exists (select * from sysobjects where id = object_id(N'[dbo].[NBPM_CLASSFILE]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[NBPM_CLASSFILE]
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[NBPM_ASSEMBLYFILE]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[NBPM_ASSEMBLYFILE]
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[NBPM_FLOW]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[NBPM_FLOW]
GO
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -