在Azure SQL数据库中启用和配置FILESTREAM [英] Enable and Configure FILESTREAM in azure sql db
问题描述
请建议我如何将pdf文件存储在AZURE SQL DB中.
Please suggest on how I may store pdf file in AZURE SQL DB.
以上要求我在Azure SQL DB上启用和配置FILESTREAM.
The above would require me to enable and configure FILESTREAM on the Azure SQL DB.
当前,当我运行创建表"查询时出现此错误:
Currently I am getting this error when I run the Create Table query :
消息40517,第16级,状态1,第28行 此版本的SQL Server不支持关键字或语句选项'file stream_on'.
Msg 40517, Level 16, State 1, Line 28 Keyword or statement option 'file stream_on' is not supported in this version of SQL Server.
CREATE TABLE [MyDocs](
[id] [int] IDENTITY(1,1) NOT NULL,
[DocId] [int] not null,
[DocFileDat] [varbinary](max) FILESTREAM NULL,
[DocFileType] [varchar](5) NULL,
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 [PRIMRAY]
) ON [PRIMARY] FILESTREAM_ON [FilestreamGroup1]
推荐答案
Azure SQL DB不支持FILESTREAM,并且我们不确定它是否会在不久的将来添加.因此,我建议使用一些替代方法,例如:
FILESTREAM is not supported in Azure SQL DB, and we don't have some confirmation that it will be added in the near future. So, I would recommend to use some alternative such as:
- 将全部内容存储到数据库内VARBINARY(MAX)列中.这可能会增加数据库大小.
- 将文件的内容存储在Azure Blob存储中,并将路径/URL保留在表中.您可以通过url/path直接访问blob存储上的文件,但是当删除数据库中的相关行时,您需要确保删除文件.
这篇关于在Azure SQL数据库中启用和配置FILESTREAM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!