SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[User](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[classid] [int] NOT NULL CONSTRAINT [DF_User_classid]  DEFAULT ((0)),
	[username] [nvarchar](30) COLLATE Chinese_PRC_CI_AS NOT NULL CONSTRAINT [DF_Administrator_admin_username]  DEFAULT (''),
	[password] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL CONSTRAINT [DF_Administrator_admin_password]  DEFAULT (''),
	[loginnumber] [int] NOT NULL CONSTRAINT [DF_Administrator_admin_loginnumber]  DEFAULT ((0)),
	[addtime] [datetime] NOT NULL,
	[lastlogintime] [datetime] NOT NULL,
	[lastloginip] [nvarchar](20) COLLATE Chinese_PRC_CI_AS NOT NULL CONSTRAINT [DF_Administrator_admin_endip]  DEFAULT (''),
 CONSTRAINT [PK_Administrator] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'管理员表(主键)' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'User', @level2type=N'COLUMN', @level2name=N'id'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'管理员表(所属管理员分类ID)' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'User', @level2type=N'COLUMN', @level2name=N'classid'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'管理员表(用户名)' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'User', @level2type=N'COLUMN', @level2name=N'username'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'管理员表(密码)' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'User', @level2type=N'COLUMN', @level2name=N'password'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'管理员表(登录次数)' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'User', @level2type=N'COLUMN', @level2name=N'loginnumber'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'管理员表(添加时间)' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'User', @level2type=N'COLUMN', @level2name=N'addtime'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'管理员表(最后登录时间)' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'User', @level2type=N'COLUMN', @level2name=N'lastlogintime'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'管理员表(最后登陆IP)' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'User', @level2type=N'COLUMN', @level2name=N'lastloginip'

insert into [User] (classid,username,password,loginnumber,addtime,lastlogintime,lastloginip)values(1,'admin','21232f297a57a5a743894a0e4a801fc3',0,getdate(),getdate(),'')