/**说明:1、启用数据库实例fileSTREAM: 1)在sql Server配置管理器中打开sql Server数据库引擎的属性窗口,切换到fileSTREAM选项卡,选中“针对Transact-sql访问启用fileSTREAM”等三个复选框,然后单击“确定”按钮保存对fileSTREAM的设置。 2)打开sql Server Management Studio连接到数据库实例,右击数据库实例,选择“属性”选项,切换的“高级”选项页,在文件流访问级别下拉列表框中选择“已启用完全访问”选项。2、手动创建数据库COSTSW;3、指定以下文件组根路径,确保位于NTFS文件系统磁盘;4、执行以下代码。**/ALTER DATABASE [COSTSW]ADD fileGROUP [COSTSWGroup] CONTAINS fileSTREAMGOALTER DATABASE [COSTSW]ADD file ( name = N'fileStream',filename = N'D:\doc\fileStream') --文件组路径TO fileGROUP [COSTSWGroup]GO/****** Object: table [dbo].[files] Script Date: 08/05/2010 14:45:45 ******/SET ANSI_NulLS ONGOSET QUOTED_IDENTIFIER ONGOSET ANSI_padding ONGOCREATE table [dbo].[files]( [ID] [int] NOT NulL,[fileID] [uniqueIDentifIEr] ROWGUIDCol NOT NulL,[Title] [nvarchar](500) NOT NulL,[fileContent] [varbinary](max) fileSTREAM NulL,--文件实体 [Extension] [nvarchar](20) NOT NulL,[Size] [int] NOT NulL,[UploadDate] [datetime] NOT NulL,[SystemUserID] [int] NOT NulL,CONSTRAINT [PK_files] 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] fileSTREAM_ON [COSTSWGroup],UNIQUE NONCLUSTERED ( [fileID] ASC)WITH (PAD_INDEX = OFF,ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]) ON [PRIMARY] fileSTREAM_ON [COSTSWGroup]GOSET ANSI_padding OFFGOEXEC sys.sp_addextendedproperty @name=N'MS_Description',@value=N'编号',@level0type=N'SCHEMA',@level0name=N'dbo',@level1type=N'table',@level1name=N'files',@level2type=N'ColUMN',@level2name=N'ID'GOEXEC sys.sp_addextendedproperty @name=N'MS_Description',@value=N'GUID编号',@level2name=N'fileID'GOEXEC sys.sp_addextendedproperty @name=N'MS_Description',@value=N'标题',@level2name=N'Title'GOEXEC sys.sp_addextendedproperty @name=N'MS_Description',@value=N'文件数据',@level2name=N'fileContent'GOEXEC sys.sp_addextendedproperty @name=N'MS_Description',@value=N'扩展名',@level2name=N'Extension'GOEXEC sys.sp_addextendedproperty @name=N'MS_Description',@value=N'文件大小(单位:字节)',@level2name=N'Size'GOEXEC sys.sp_addextendedproperty @name=N'MS_Description',@value=N'上传时间',@level2name=N'UploadDate'GOEXEC sys.sp_addextendedproperty @name=N'MS_Description',@value=N'上传管理员编号',@level2name=N'SystemUserID'GO总结
以上是内存溢出为你收集整理的sqlserver2008 文件流全部内容,希望文章能够帮你解决sqlserver2008 文件流所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)