filetable - FileTable file_stream 列:“无法在 varbinary 上调用方法”
问题描述
我正在尝试使用此处记录的 file_stream.GetFileNamespacePath(): https ://docs.microsoft.com/en-us/sql/relational-databases/system-functions/getfilenamespacepath-transact-sql?view=sql-server -2017使用此代码:
使用 StepwiseProcedures
声明@root varchar(100)
SELECT @root = FileTableRootPath();
声明@fullPath varchar(1000);
SELECT @fullPath = @root + Code_filetable.file_stream.GetFileNamespacePath() FROM Code_filetable
WHERE Name = '118.txt';
此代码未通过语法检查,消息为:“无法在 varbinary 上调用方法”
file_stream 列的类型为 varbinary(MAX),在为每个创建的 FileTable 强制实施的固定模式中。一年多以来,我一直在使用多个 FileTable,并且其他操作都按照记录进行。
如果我无法让 GetFileNamespacePath() 工作,我将不得不以某种方式对我在文件管理器中看到的路径进行硬编码,或者可能迁移到 SQL Server 2016 或更高版本。
请注意,您必须先建立数据库实例以支持 FILESTREAM 等,然后才能创建和使用 FileTable 并重现此问题。此处描述了配置:
https ://docs.microsoft.com/en-us/sql/relational-databases/blob/enable-and-configure-filestream?view=sql-server-2017
我通过以下链接阅读了以下内容,但没有什么能解决这个问题。
SQL FileTable GetFileNamespacePath
https://www.sqlservercentral.com/Forums/Topic1715710-3077-1.aspx
https://sqltales.wordpress.com/2012/05/15/varbinary-vs-filestream-and-other-blob-issues-3/
https://www.databasejournal.com/features/mssql/filestream-and-filetable-in-sql-server-2012.html
https://svenaelterman.wordpress.com/2012/07/31/pathname-versus-getfilenamespacepath/
我正在使用 Microsoft SQL Server 2014(企业 64 位)
谢谢
解决方案
推荐阅读
- sequelize.js - 从响应中删除“包含”表名 - Sequelize
- reactjs - initialRouteName 不起作用,React-Native
- ios - 允许根据 UITouch.TouchType 使用 point(inside:with:) 与后面的视图交互。(PKCanvasView)
- c# - 对字典中的数组进行排序
- node.js - Homebrew 说我有节点 16.1.0,但我实际上有 v12.18.4
- python - 在Python中的相同df中从字典项中创建单独的列
- c++ - C ++中基于文本的战斗系统无法正常工作,不知道为什么
- php - 错误必须是数组类型,在 laravel 中给出 null
- rdl - 如何使用 RDL 创建外部窗口以打开谷歌地图(地址)。(文本框表达式)
- javascript - 无法覆盖 plotly.js 上的新图