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

📄 syposinit.sql

📁 这是用PB6开发的一个POS管理系统
💻 SQL
📖 第 1 页 / 共 5 页
字号:
use master
go
sp_dboption 'sypos','trunc. log on chkpt.',true
go
sp_dboption 'sypos','select into/bulkcopy',true
go
sp_dboption 'sypos','ANSI null default',true
go

sp_addlogin 'sypos'
go
sp_addlogin 'posuser','posuser'
go

print 'End Add Login'
go

use sypos
go
sp_addalias 'sypos','dbo'
go
sp_addalias 'posuser','dbo'
go

print 'End Add alias to login '
go

Sp_AddType 'TGOODS', 'CHAR(13)'
go
Sp_AddType 'TDEPT',  'CHAR(4)'
go
Sp_AddType 'TGROUP', 'CHAR(4)'
go
Sp_AddType 'TCLASS', 'CHAR(8)'
go
Sp_AddType 'TSTAFF', 'CHAR(5)'
go
Sp_AddType 'TVENDOR','CHAR(8)'
go
Sp_AddType 'TCARD',  'VARCHAR(16)'
go
Sp_AddType 'TPAYMODE','CHAR(2)'
go
Sp_AddType 'TDATE',  'DATETIME'
go
Sp_AddType 'TUDF',    'VARCHAR(10)'
go
Sp_AddType 'TRECEIPT', 'CHAR(10)'
go
Sp_AddType 'TINVOICE','VARCHAR(12)'
go
Sp_AddType 'TBATCH',   'VARCHAR(20)'
go
Sp_AddType 'TDISCOUNT', 'NUMERIC(5,3)'
go
Sp_AddType 'TPRICE',     'FLOAT'
go
Sp_AddType 'TAMT',    'NUMERIC(12,2)'
go
Sp_AddType 'TQTY',    'NUMERIC(12,4)'
go
Sp_AddType 'TMEMO',   'VARCHAR(200)'
go

print ' end add user define data type '
go

Create Default default_amt as 0
go
create default default_dis as 1
go
sp_bindefault default_amt,'TAMT'
go
SP_BINDEFAULT default_amt,'TPrice'
go
SP_BINDEFAULT default_amt,'TQTY'
go
SP_BINDEFAULT default_dis,'TDISCOUNT'
go

print ' end Create Default value to user define data type'
go
/* ============================================================ */
/*   Database name:  SYPOS                                      */
/*   DBMS name:      Microsoft SQL Server 7.x                   */
/*   Created on:     2000-12-15  14:22                          */
/* ============================================================ */

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

⌨️ 快捷键说明

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