SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [UploadFiles](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[Category] [int] NULL CONSTRAINT [DF_UploadFiles_Category]  DEFAULT ((0)),
	[RecordID] [bigint] NULL CONSTRAINT [DF_UploadFiles_RecordID]  DEFAULT ((0)),
	[Path] [varchar](200) NULL,
	[Length] [int] NULL CONSTRAINT [DF_UploadFiles_Length]  DEFAULT ((0)),
	[FileName] [varchar](100) NULL,
	[Account] [varchar](50) NULL,
	[UploadDate] [datetime] NULL CONSTRAINT [DF_UploadFiles_UploadDate]  DEFAULT (getdate()),
	[IP] [varchar](50) NULL,
	[Status] [int] NULL CONSTRAINT [DF_UploadFiles_Status]  DEFAULT ((1)),
	[Remark] [nvarchar](300) NULL,
 CONSTRAINT [PK_UploadFiles] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
SET IDENTITY_INSERT [UploadFiles] ON 

INSERT [UploadFiles] ([ID], [Category], [RecordID], [Path], [Length], [FileName], [Account], [UploadDate], [IP], [Status], [Remark]) VALUES (1, 1, 0, N'UploadFiles/Demo/2013/03/04/126logo.gif', 6, NULL, NULL, CAST(N'2013-03-04 14:09:30.160' AS DateTime), N'::1', 1, NULL)
INSERT [UploadFiles] ([ID], [Category], [RecordID], [Path], [Length], [FileName], [Account], [UploadDate], [IP], [Status], [Remark]) VALUES (2, 1, 0, N'UploadFiles/Demo/2013/03/04/126logo.gif', 6, NULL, NULL, CAST(N'2013-03-04 15:04:44.550' AS DateTime), N'::1', 1, NULL)
SET IDENTITY_INSERT [UploadFiles] OFF
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文件表自增长编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'UploadFiles', @level2type=N'COLUMN',@level2name=N'ID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'自定义类别,默认为0' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'UploadFiles', @level2type=N'COLUMN',@level2name=N'Category'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'可选,记录编号, 默认为0' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'UploadFiles', @level2type=N'COLUMN',@level2name=N'RecordID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文件路径' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'UploadFiles', @level2type=N'COLUMN',@level2name=N'Path'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文件长度,单位KB' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'UploadFiles', @level2type=N'COLUMN',@level2name=N'Length'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文件名,无则为空' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'UploadFiles', @level2type=N'COLUMN',@level2name=N'FileName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文件上传者,无则为空' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'UploadFiles', @level2type=N'COLUMN',@level2name=N'Account'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'上传日期,默认为当前日期' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'UploadFiles', @level2type=N'COLUMN',@level2name=N'UploadDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'上传者IP地址,可选' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'UploadFiles', @level2type=N'COLUMN',@level2name=N'IP'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'当前文件状态,1有效(默认),2待删除' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'UploadFiles', @level2type=N'COLUMN',@level2name=N'Status'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'UploadFiles', @level2type=N'COLUMN',@level2name=N'Remark'
GO
