《进销存管理系统数据库设计.pdf》由会员分享,可在线阅读,更多相关《进销存管理系统数据库设计.pdf(30页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、25This document is for reference only-rar21 year.March 1.2ERE-RE-RE-RER3E-RE-R4E-R51.(1)(2)(3)(4)(5)(6)(7)8(9)(10)(11)12 3 1.6.1 51.6.36(1)(2)(3)B1CharNULLull5B2CharNULL20B3INULLTNULL20B4floatNULL20B5DateTimeNULL20B6CharNULL20B7CharNULL50B8CharNULL20B9CharNULL50B10CharNULL40B11CharNULL20 B12INULLTNU
2、LL20B13CharNULL20B14INULLTNULL20B15CharNULL20B16CharNULL20B17CharNULL20B18CharNULL20B19CharNULL20 F1-1B1+B2+B3+B3+B12Pl-1 P1-2 S1B1+B2+B3+B1510S2B1+B2+B3+B4+B16100 S3B1+B2+B3+B4+B6+ID1710L1B1+B2+B3+B4+B6100 L2B1+B2+B3+B4+B6+B1010C1B1+B2+B3+B4+B6+B18100 F1-2B8+B9+B14P1-1F1-3B1+B2+B3+B4+B18P1-3F2-1B1+
3、B2+B3+B4+B6P2-2F2-2B1+B2+B3+B4+B6+B10P2-1F3-1B1+B2+B3+B4+B6+B18P3-1 P1-1S1 P1-2P1-3S2P2-1L1P2-2P3-1C11.7.5.S1-1S1S2S1-2S3S2S2S1-3L1L2S1-4C1 2E-R2.1.1E-R (1)(2)IS?)/CE)1 1 P-J M-mf gm1m51(3)(4)(5)2.1.2E-R 0(j-(1)(2)(3)(4)(5)2.1.3E-R (1)(2)(3)(4)(5)E-RmI n m (1)(2)(3)(4)(5)(6)(7)(8)111(9)(10)(11)(12)(
4、13)(14)(15)3E-RE-R(1)(2)(3)4LIE-RDBMSDBMS(1)(2)1:1(3)1:nnE-R1.2.3 7.8.9.4.5.6.1011.it12.1)2)1)2)1)2)1)2)1)2)123IJ455 Microsoft SQL Server1)2)3)ZG Nvarchar(50)Nvarchar(50)Nvarchar(50)Nvarchar(50)Nvarchar(50)alter table dbo.ZG add constraint PK_gh primary key clustered alter table dbo.ZG add constrain
5、t def_defaultfor alter table add constraint def_xb check(or BM nvarchar(50)nvarchar(50)alter table dbo.BM add constraint PK_bmbh primary key clustered!CLXX varchar(50)varchar(50)varchar(50)datetime(50)varchar(50)varchar(50)alter table dbo.CLXX add constraint PK_cldbh primary key clustered(GYXX Nvarc
6、har(50)Nvarchar(50)0 Nvarchar(50)Nvarchar(50)alter table dbo.GYXX add constraint PK_cgdbh primary key clustered(alter table dbo.GYXX add constraint def_spsl default 0 for GMXX Nvarchar(50)Nvarchar(50)0 Nvarchar(50)Nvarchar(50)alter table dbo.GMXX add constraint PK_xsdbh primary key clustered(alter t
7、able dbo.GMXX add constraint def_spsl default 0 for CHD Nvarchar(50)Nvarchar(50)0 Nvarchar(50)datetime(50)Nvarchar(50)alter table dbo.CHD add constraint PK_chdbh primary key clustered(alter table dbo.CHD add constraint def_spsl default 0 for CGD Nvarchar(50)Nvarchar(50)0 Nvarchar(50)datetime(8)Nvarc
8、har(50)alter table dbo.CGD add constraint PK_cgdbh primary key clustered(/ALTER alter table dbo.CGD add constraint def_l default 0 for BSD Nvarchar(50)Nvarchar(50)0 Nvarchar(50)datetime(SO)Nvarchar(50)alter table dbo.BSD add constraint PK_bsdbh primary key clustered(alter table dbo.BSD add constrain
9、t def_spsl default 0 for CREATE DEFAULTowner default_name AS constant_expression sp_bindefault_name,object_name,futureonly CREATE RULE rule_name AS condition_expression sp_bindrule rule_name,object_name,futreonly ZGcreate default df_sex ASsp_bindefault df_sex/ZG.sp_unbindefault1 ZGdrop default df_se
10、x CREATE RULEsp_bindrule(1)ZGsex_rule CREATE RULE check_sex AS or sp_bindrule check_sex,zdbo.ZG.(2)GYXX amount_rule CREATE RULE amount_rule AS amount=100 and amount=100 and(amount=100 and(amount=100 and(amount=1000 sp_bindrule amount_rule z CGD.SQL(1)(2)(3)(4)Create procedure up_get_ AS SelectFrom Z
11、G Order by ASC EXEC up_get_ Create procedure up_get_jj AS Select From GMXX Order by ASC EXECup_get_ Create procedure up_get_H AS Select,From CGD Order by ASC EXEC up_get_select.ZG,create trigger select_ZG on for insert as select*from inserted insert into values(004:bsl4T004T UPDATECLXXCGDCHDCreate t
12、rigger updatenum_trigger On CLXX For update As Update CGD Set(select From inserted Update CHD Set(select From inserted(1)Exec sp_addlogin,bsl084,z,123/,bsl bsl(2)Use bsl Exec sp_grantdbaccess UserName,bsl(bsl084)Exec sp_add UserNameRole(3)CLXX select GMXX select insertdeleteupdate CLXX select CGD selectinserts deleteupdate select insertdeleteupdate Grant select table to username