Physical location of FILESTREAM data

前端 未结 5 530
清酒与你
清酒与你 2021-01-06 07:47

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?

5条回答
  •  有刺的猬
    2021-01-06 08:30

    I know this is an older post but as it still comes up high in the Google search rankings I thought I'd post an answer. Certainly in later versions of SQL (I've not tried this on 2008) you can run the following query:

    SELECT      t.name AS 'table',
                c.name AS 'column', 
                fg.name AS 'filegroup_name', 
                dbf.type_desc AS 'type_description',
                dbf.physical_name AS 'physical_location'
    FROM        sys.filegroups fg
    INNER JOIN  sys.database_files dbf
    ON          fg.data_space_id = dbf.data_space_id
    INNER JOIN  sys.tables t
    ON          fg.data_space_id = t.filestream_data_space_id
    INNER JOIN  sys.columns c
    ON          t.object_id = c.object_id
    AND         c.is_filestream = 1
    

    Source

提交回复
热议问题