FILESTREAM数据的物理位置 [英] Physical location of FILESTREAM data

查看:86
本文介绍了FILESTREAM数据的物理位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎么知道刚插入数据库的FILESTREAM数据的物理位置(以便在Windows资源管理器中看到)?

How could I know the physical location (so I can see it in Windows Explorer) path of a FILESTREAM data that I've just inserted into DB?

推荐答案

对此有一个选择:方法PhysicalPathName().如果您现在使用的是SQL Server 2012或更高版本,则此代码将为您工作:

There is one option for this: method PhysicalPathName(). If you are on SQL Server 2012 or upper now, this code will work for you:

SELECT stream.PhysicalPathName() AS 'Path' FROM Media
OPTION (QUERYTRACEON 5556)

对于SQL Server 2008/2008 R2,您需要为整个实例启用跟踪标志5556:

For SQL Server 2008/2008 R2 you will need to enable trace flag 5556 for the whole instance:

DBCC TRACEON (5556, -1)
GO

,或者对于您要在其中调用PhysicalPathName()方法的特定连接:

or for the particular connection in which you are calling PhysicalPathName() method:

DBCC TRACEON (5556, -1)
GO

这篇关于FILESTREAM数据的物理位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆