标签:
CREATE DATABASE Test
use Test
--创建用户类型表
CREATE TABLE UserType (
ID INT NOT NULL identity(1,1) primary key,
TypeName VARCHAR(200) DEFAULT NULL ,
TypeDescription VARCHAR(200) DEFAULT NULL ,
)
exec sys.sp_addextendedproperty @name=‘MS_Description‘,@value= ‘自增长主键‘,@level0type=‘schema‘,@level0name=‘dbo‘,@level1type=‘table‘,@level1name=‘UserType‘,@LEVEL2TYPE=‘COLUMN‘,@level2name=‘ID‘
exec sys.sp_addextendedproperty @name=‘MS_DESCRIPTION‘,@value=‘用户类型名称‘,@level0type=‘schema‘,@level0name=‘dbo‘,@level1type=‘table‘,@level1name=‘UserType‘,@level2type=‘column‘,@level2name=‘TypeName‘
exec sys.sp_addextendedproperty @name=‘ms_description‘,@value=‘用户类型描述‘,@level0type=‘schema‘,@level0name=‘dbo‘,@level1type=‘table‘,@level1name=‘UserType‘,@level2type=‘coloum‘,@level2name=‘TypeDescription‘
-- 创建一个用户信息数据表
CREATE TABLE UserInfo (
ID INT NOT NULL identity(1,1) primary key,
UserName VARCHAR(200) DEFAULT NULL ,
UserLogin VARCHAR(200) DEFAULT NULL ,
UserPassword VARCHAR(200) DEFAULT NULL ,
UserEmail VARCHAR(100) DEFAULT NULL ,
UserType int DEFAULT NULL ,
CONSTRAINT userinfo_ibfk_1 FOREIGN KEY (UserType) REFERENCES usertype (ID)
)
exec sys.sp_addextendedproperty @name=‘MS_Description‘,@value= ‘自增长主键‘,@level0type=‘schema‘,@level0name=‘dbo‘,@level1type=‘table‘,@level1name=‘UserInfo‘,@LEVEL2TYPE=‘COLUMN‘,@level2name=‘ID‘
exec sys.sp_addextendedproperty @name=‘MS_DESCRIPTION‘,@value=‘用户姓名‘,@level0type=‘schema‘,@level0name=‘dbo‘,@level1type=‘table‘,@level1name=‘UserInfo‘,@level2type=‘column‘,@level2name=‘UserName‘
exec sys.sp_addextendedproperty @name=‘ms_description‘,@value=‘用户登录名‘,@level0type=‘schema‘,@level0name=‘dbo‘,@level1type=‘table‘,@level1name=‘UserInfo‘,@level2type=‘coloum‘,@level2name=‘UserLogin‘
exec sys.sp_addextendedproperty @name=‘MS_Description‘,@value= ‘密码‘,@level0type=‘schema‘,@level0name=‘dbo‘,@level1type=‘table‘,@level1name=‘UserInfo‘,@LEVEL2TYPE=‘COLUMN‘,@level2name=‘UserPassword‘
exec sys.sp_addextendedproperty @name=‘MS_DESCRIPTION‘,@value=‘电子邮箱‘,@level0type=‘schema‘,@level0name=‘dbo‘,@level1type=‘table‘,@level1name=‘UserInfo‘,@level2type=‘column‘,@level2name=‘UserEmail‘
exec sys.sp_addextendedproperty @name=‘ms_description‘,@value=‘用户类型‘,@level0type=‘schema‘,@level0name=‘dbo‘,@level1type=‘table‘,@level1name=‘UserInfo‘,@level2type=‘coloum‘,@level2name=‘UserType‘
标签:
原文地址:http://www.cnblogs.com/zhaochengshen/p/5612269.html