⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 crebas.sql

📁 重大环境危险源管理仅供参考
💻 SQL
📖 第 1 页 / 共 3 页
字号:
IF EXISTS (SELECT name FROM master.dbo.sysdatabases WHERE name = 'hbzdwxygl')
	DROP DATABASE hbzdwxygl
GO

CREATE DATABASE hbzdwxygl  

GO


use hbzdwxygl


if exists (select 1
            from  sysobjects
           where  id = object_id('DLX')
            and   type = 'U')
   drop table DLX
go

if exists (select 1
            from  sysobjects
           where  id = object_id('USERDW')
            and   type = 'U')
   drop table USERDW
go

if exists (select 1
            from  sysobjects
           where  id = object_id('WRWSJPF')
            and   type = 'U')
   drop table WRWSJPF
go

if exists (select 1
            from  sysobjects
           where  id = object_id('HJWRWPFBZ')
            and   type = 'U')
   drop table HJWRWPFBZ
go

if exists (select 1
            from  sysobjects
           where  id = object_id('HJWRWFXFF')
            and   type = 'U')
   drop table HJWRWFXFF
go

if exists (select 1
            from  sysobjects
           where  id = object_id('WXYJCBM')
            and   type = 'U')
   drop table WXYJCBM
go

if exists (select 1
            from  sysobjects
           where  id = object_id('SGYHZLFA')
            and   type = 'U')
   drop table SGYHZLFA
go

if exists (select 1
            from  sysobjects
           where  id = object_id('SGYHYJYA')
            and   type = 'U')
   drop table SGYHYJYA
go

if exists (select 1
            from  sysobjects
           where  id = object_id('SGYHYF')
            and   type = 'U')
   drop table SGYHYF
go

if exists (select 1
            from  sysobjects
           where  id = object_id('SGYHPG')
            and   type = 'U')
   drop table SGYHPG
go

if exists (select 1
            from  sysobjects
           where  id = object_id('CDWXYZB')
            and   type = 'U')
   drop table CDWXYZB
go

if exists (select 1
            from  sysobjects
           where  id = object_id('CDWXYLJL')
            and   type = 'U')
   drop table CDWXYLJL
go

if exists (select 1
            from  sysobjects
           where  id = object_id('FG')
            and   type = 'U')
   drop table FG
go

if exists (select 1
            from  sysobjects
           where  id = object_id('FQCL')
            and   type = 'U')
   drop table FQCL
go

if exists (select 1
            from  sysobjects
           where  id = object_id('STX')
            and   type = 'U')
   drop table STX
go

if exists (select 1
            from  sysobjects
           where  id = object_id('HXPLHTX')
            and   type = 'U')
   drop table HXPLHTX
go

if exists (select 1
            from  sysobjects
           where  id = object_id('HXPCZFH')
            and   type = 'U')
   drop table HXPCZFH
go

if exists (select 1
            from  sysobjects
           where  id = object_id('HXPXFYJ')
            and   type = 'U')
   drop table HXPXFYJ
go

if exists (select 1
            from  sysobjects
           where  id = object_id('HXPJJ')
            and   type = 'U')
   drop table HXPJJ
go

if exists (select 1
            from  sysobjects
           where  id = object_id('HXPWXX')
            and   type = 'U')
   drop table HXPWXX
go

if exists (select 1
            from  sysobjects
           where  id = object_id('HXPCF')
            and   type = 'U')
   drop table HXPCF
go

if exists (select 1
            from  sysobjects
           where  id = object_id('HXPCZXX')
            and   type = 'U')
   drop table HXPCZXX
go

if exists (select 1
            from  sysobjects
           where  id = object_id('GYJCBM')
            and   type = 'U')
   drop table GYJCBM
go

if exists (select 1
            from  sysobjects
           where  id = object_id('WXPDWXX')
            and   type = 'U')
   drop table WXPDWXX
go

if exists (select 1
            from  sysobjects
           where  id = object_id('PWDWXX')
            and   type = 'U')
   drop table PWDWXX
go

if exists (select 1
            from  sysobjects
           where  id = object_id('HXPBS')
            and   type = 'U')
   drop table HXPBS
go

if exists (select 1
            from  sysobjects
           where  id = object_id('HJZLBZ')
            and   type = 'U')
   drop table HJZLBZ
go

if exists (select 1
            from  sysobjects
           where  id = object_id('SGYHXX')
            and   type = 'U')
   drop table SGYHXX
go

if exists (select 1
            from  sysobjects
           where  id = object_id('CDWXY')
            and   type = 'U')
   drop table CDWXY
go

if exists (select 1
            from  sysobjects
           where  id = object_id('WXYCZL')
            and   type = 'U')
   drop table WXYCZL
go

if exists (select 1
            from  sysobjects
           where  id = object_id('WXWPMB')
            and   type = 'U')
   drop table WXWPMB
go

if exists (select 1
            from  sysobjects
           where  id = object_id('GYJCLX')
            and   type = 'U')
   drop table GYJCLX
go

if exists (select 1
            from  sysobjects
           where  id = object_id('WRWDM')
            and   type = 'U')
   drop table WRWDM
go

if exists (select 1
            from  sysobjects
           where  id = object_id('USERCODE')
            and   type = 'U')
   drop table USERCODE
go

if exists (select 1
            from  sysobjects
           where  id = object_id('WXYJCLX')
            and   type = 'U')
   drop table WXYJCLX
go

if exists (select 1
            from  sysobjects
           where  id = object_id('WXDYXX')
            and   type = 'U')
   drop table WXDYXX
go

if exists (select 1
            from  sysobjects
           where  id = object_id('DWXX')
            and   type = 'U')
   drop table DWXX
go

if exists (select 1
            from  sysobjects
           where  id = object_id('ZGBM')
            and   type = 'U')
   drop table ZGBM
go

if exists (select 1
            from  sysobjects
           where  id = object_id('QYLX')
            and   type = 'U')
   drop table QYLX
go

if exists (select 1
            from  sysobjects
           where  id = object_id('GXGM')
            and   type = 'U')
   drop table GXGM
go

if exists (select 1
            from  sysobjects
           where  id = object_id('LXGX')
            and   type = 'U')
   drop table LXGX
go

if exists (select 1
            from  sysobjects
           where  id = object_id('HXLX')
            and   type = 'U')
   drop table HXLX
go

if exists (select 1
            from  sysobjects
           where  id = object_id('JJLX')
            and   type = 'U')
   drop table JJLX
go

if exists (select 1
            from  sysobjects
           where  id = object_id('DQBM')
            and   type = 'U')
   drop table DQBM
go

if exists (select 1
            from  sysobjects
           where  id = object_id('MEASURECODE')
            and   type = 'U')
   drop table MEASURECODE
go

if exists(select 1 from dbo.systypes where name ='T_DANGERID')
  execute sp_droptype T_DANGERID
go

sp_addtype T_DANGERID, 'nvarchar(5)', 'null'
go

if exists(select 1 from dbo.systypes where name ='T_DANGERNAME')
  execute sp_droptype T_DANGERNAME
go

sp_addtype T_DANGERNAME, 'nvarchar(60)', 'null'
go

if exists(select 1 from dbo.systypes where name ='T_ENTERPRISEID')
  execute sp_droptype T_ENTERPRISEID
go

sp_addtype T_ENTERPRISEID, 'nvarchar(12)', 'null'
go

if exists(select 1 from dbo.systypes where name ='T_ENTERPRISENAME')
  execute sp_droptype T_ENTERPRISENAME
go

sp_addtype T_ENTERPRISENAME, 'nvarchar(60)', 'null'
go

if exists(select 1 from dbo.systypes where name ='T_MEASURE')
  execute sp_droptype T_MEASURE
go

sp_addtype T_MEASURE, 'nvarchar(20)', 'null'
go

/* ============================================================ */
/*   Table: MEASURECODE                                         */
/* ============================================================ */
create table MEASURECODE
(
    MEASUREID     nvarchar(10)          not null,
    SYMBOL        nvarchar(16)          null    ,
    NAME          nvarchar(60)          null    ,
    BASIC         nvarchar(1)           null    ,
    CONVERSION    decimal(18,6)         null    ,
    STANDARD      nvarchar(16)          null    ,
    constraint PK_MEASURECODE primary key (MEASUREID)
)
go

/* ============================================================ */
/*   Table: DQBM                                                */
/* ============================================================ */
create table DQBM
(
    BM            nvarchar(10)          not null,
    MC            nvarchar(60)          null    ,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -