Ylbtech-dbs:ylbtech-6,record (Life record) |
-- =============================================
--Databasename:record
--desc: Record (Life record)
--Creative ideas: History cannot be modified, but can be amended to trace the evolution process.
--pubdate:16:46 2015/1/12
--Author:ylbtech
-- =============================================
1.A, Database diagram (db Diagram) back to top |
1.B, database design script back to top |
1.b.1,record.sql
-- =============================================--Databasename:record--desc: Record (Life record)--Creative Ideas: History cannot be modified, but can be amended to trace the evolution process. --pubdate:16:46 2015/1/12--Author:ylbtech-- ============================================= UseMasterGO--Drop The database if it already existsIF EXISTS ( SELECTname fromsys.databasesWHEREName=N'Record')DROP DATABASERecordGOCREATE DATABASERecordGo UseRecordGo-- =============================================--ylb:1, Account form-- =============================================Create TableAccount (AccountIdint Identity(101001,1)Primary Key,--ref. "ID,PK"Usernamevarchar( -),--User namePwdvarchar( -),--PasswordIntrovarchar( -),--Personal Signaturepubdatedatetime,--Registration TimeDisablebit default(0)--whether 0 is disabled: normal; 1: Disabled)GO-- =============================================--ylb: Category table-- =============================================Create TableCategory (CategoryIdint Identity(101,1)Primary Key,--numberingCategoryNamevarchar( $),--categoryDisablebit default(0),--whether 0 is disabled: normal; 1: DisabledAccountIdint --Account ID "FK")Go-- =============================================--ylb: Record table--refers:recordversion-- =============================================Create TableRecord (RecordIdint Identity(1,1)Primary Key,--numberingTitlevarchar( -),--titleContentvarchar( -),--contentpubdatedatetime default(getdate()),--Date CreatedEndeditdatedatetime,--Last Modified DateDisablebit default(0),--whether 0 is disabled: normal; 1: DisabledAccountIdint,--Account ID "FK"CategoryIdint --Category ID "FK")-- =============================================--ylb: Record version table-- =============================================Create Tablerecordversion (Recordversionidint Identity(1,1)Primary Key,--numberingTitlevarchar( -),--titleContentvarchar( -),--contentpubdatedatetime default(getdate()),--Release dateDisablebit default(0),--whether 0 is disabled: normal; 1: DisabledAccountIdint,--Account ID "FK"RecordIdint,--record ID "FK")
View Code
1.b.2,
1.C, functional implementation code (function implementation codes) back to top |
|
Ylbtech Source: http://ylbtech.cnblogs.com/ This article is copyright to the author and the blog Park, Welcome to reprint, but without the consent of the author must retain this paragraph, and in the article page obvious location to the original link, otherwise reserves the right to pursue legal responsibility. |
Ylbtech-dbs:ylbtech-6,record (Life record)