📄 1.stock_table.sql
字号:
/*==============================================================*/
/* Database name: 仓库信息管理系统 */
/* DBMS name: Microsoft SQL Server 2000 */
/* Created on: 2006-4-19 */
/*==============================================================*/
if exists (select 1
from sysobjects
where id = object_id('f_accredit')
and type = 'U')
drop table f_accredit
go
if exists (select 1
from sysobjects
where id = object_id('f_client')
and type = 'U')
drop table f_client
go
if exists (select 1
from sysobjects
where id = object_id('f_corpaccredit')
and type = 'U')
drop table f_corpaccredit
go
if exists (select 1
from sysobjects
where id = object_id('f_corporation')
and type = 'U')
drop table f_corporation
go
if exists (select 1
from sysobjects
where id = object_id('f_desktopchild')
and type = 'U')
drop table f_desktopchild
go
if exists (select 1
from sysobjects
where id = object_id('f_desktopmain')
and type = 'U')
drop table f_desktopmain
go
if exists (select 1
from sysobjects
where id = object_id('dbo.f_inv_detail')
and type = 'U')
drop table dbo.f_inv_detail
go
if exists (select 1
from sysobjects
where id = object_id('dbo.f_inv_zz')
and type = 'U')
drop table dbo.f_inv_zz
go
if exists (select 1
from sysobjects
where id = object_id('dbo.f_invtx_detail')
and type = 'U')
drop table dbo.f_invtx_detail
go
if exists (select 1
from sysobjects
where id = object_id('f_loginuser')
and type = 'U')
drop table f_loginuser
go
if exists (select 1
from sysobjects
where id = object_id('dbo.f_part')
and type = 'U')
drop table dbo.f_part
go
if exists (select 1
from sysobjects
where id = object_id('f_parttype')
and type = 'U')
drop table f_parttype
go
if exists (select 1
from sysobjects
where id = object_id('f_plist')
and type = 'U')
drop table f_plist
go
if exists (select 1
from sysobjects
where id = object_id('dbo.f_storeage')
and type = 'U')
drop table dbo.f_storeage
go
if exists (select 1
from sysobjects
where id = object_id('dbo.f_storepart')
and type = 'U')
drop table dbo.f_storepart
go
if exists (select 1
from sysobjects
where id = object_id('f_vendor')
and type = 'U')
drop table f_vendor
go
if exists(select 1 from systypes where name='email')
execute sp_droptype email
go
if exists(select 1 from systypes where name='rowid')
begin
execute sp_droptype rowid
drop default d_rowid
end
go
if exists(select 1 from systypes where name='备注')
execute sp_droptype 备注
go
if exists(select 1 from systypes where name='编码')
execute sp_droptype 编码
go
if exists(select 1 from systypes where name='部门id')
execute sp_droptype 部门id
go
if exists(select 1 from systypes where name='仓库id')
execute sp_droptype 仓库id
go
if exists(select 1 from systypes where name='厂商id')
execute sp_droptype 厂商id
go
if exists(select 1 from systypes where name='单据id')
execute sp_droptype 单据id
go
if exists(select 1 from systypes where name='单据序号')
execute sp_droptype 单据序号
go
if exists(select 1 from systypes where name='单位名称')
execute sp_droptype 单位名称
go
if exists(select 1 from systypes where name='地址')
execute sp_droptype 地址
go
if exists(select 1 from systypes where name='公司id')
execute sp_droptype 公司id
go
if exists(select 1 from systypes where name='规则编码')
execute sp_droptype 规则编码
go
if exists(select 1 from systypes where name='货品id')
execute sp_droptype 货品id
go
if exists(select 1 from systypes where name='金额')
begin
execute sp_droptype 金额
drop default d_金额
end
go
if exists(select 1 from systypes where name='开户行')
execute sp_droptype 开户行
go
if exists(select 1 from systypes where name='类型')
execute sp_droptype 类型
go
if exists(select 1 from systypes where name='联系方式')
execute sp_droptype 联系方式
go
if exists(select 1 from systypes where name='联系人')
execute sp_droptype 联系人
go
if exists(select 1 from systypes where name='是否')
execute sp_droptype 是否
go
if exists(select 1 from systypes where name='数量')
begin
execute sp_droptype 数量
drop default d_数量
end
go
if exists(select 1 from systypes where name='网址')
execute sp_droptype 网址
go
if exists(select 1 from systypes where name='姓名')
execute sp_droptype 姓名
go
if exists(select 1 from systypes where name='姓名id')
execute sp_droptype 姓名id
go
/*==============================================================*/
/* Domain: email */
/*==============================================================*/
execute sp_addtype email, 'nvarchar(40)'
go
/*==============================================================*/
/* Domain: rowid */
/*==============================================================*/
execute sp_addtype rowid, 'char(36)'
go
create default d_rowid
as convert(char(36),newid())
go
sp_bindefault d_rowid, rowid
go
/*==============================================================*/
/* Domain: 备注 */
/*==============================================================*/
execute sp_addtype 备注, 'varchar(80)'
go
/*==============================================================*/
/* Domain: 编码 */
/*==============================================================*/
execute sp_addtype 编码, 'char(30)'
go
/*==============================================================*/
/* Domain: 部门id */
/*==============================================================*/
execute sp_addtype 部门id, 'char(30)'
go
/*==============================================================*/
/* Domain: 仓库id */
/*==============================================================*/
execute sp_addtype 仓库id, 'char(16)'
go
/*==============================================================*/
/* Domain: 厂商id */
/*==============================================================*/
execute sp_addtype 厂商id, 'char(36)'
go
/*==============================================================*/
/* Domain: 单据id */
/*==============================================================*/
execute sp_addtype 单据id, 'char(36)'
go
/*==============================================================*/
/* Domain: 单据序号 */
/*==============================================================*/
execute sp_addtype 单据序号, 'smallint'
go
/*==============================================================*/
/* Domain: 单位名称 */
/*==============================================================*/
execute sp_addtype 单位名称, 'nvarchar(40)'
go
/*==============================================================*/
/* Domain: 地址 */
/*==============================================================*/
execute sp_addtype 地址, 'nvarchar(50)'
go
/*==============================================================*/
/* Domain: 公司id */
/*==============================================================*/
execute sp_addtype 公司id, 'char(36)'
go
/*==============================================================*/
/* Domain: 规则编码 */
/*==============================================================*/
execute sp_addtype 规则编码, 'char(30)'
go
/*==============================================================*/
/* Domain: 货品id */
/*==============================================================*/
execute sp_addtype 货品id, 'char(16)'
go
/*==============================================================*/
/* Domain: 金额 */
/*==============================================================*/
execute sp_addtype 金额, 'money'
go
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -