Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

FileStream Expand / Collapse
Author
Message
Posted Wednesday, September 18, 2013 9:07 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Today @ 2:24 AM
Points: 39, Visits: 332
Hello.
I have a database with 2 filestreams and i create tables with a column varbinary(max) to a filestream and others tables with that column to the other filestream.
How do i can to know which parent filestream a table?
Thanks.



Post #1495967
Posted Wednesday, September 18, 2013 3:47 PM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Yesterday @ 3:04 PM
Points: 801, Visits: 715
I don't really understand your question. Can you elaborate?

Erland Sommarskog, SQL Server MVP, www.sommarskog.se
Post #1496156
Posted Thursday, September 19, 2013 12:46 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Today @ 2:24 AM
Points: 39, Visits: 332
Excuse me, my english is very bad.
A BD with 2 filegroups filestream.
One table in each filestream.

CREATE TABLE dbo.Table1 (
PkTable1 int NOT NULL,
FileFS1 varbinary](max FILESTREAM NULL,
Guia UNIQUEIDENTIFIER NOT NULL ROWGUIDCOL unique default (newid())
) on [PRIMARY] filestream_on [FSTR1]

CREATE TABLE dbo.Table2 (
PkTable2 int NOT NULL,
FileFS2 varbinary(max) FILESTREAM NULL,
Guia UNIQUEIDENTIFIER NOT NULL ROWGUIDCOL unique default (newid())
) on [PRIMARY] filestream_on [FSTR2]


I need to know with a DMV for example, the filestream of each table.
Thanks.



Post #1496234
Posted Thursday, September 19, 2013 3:22 PM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Yesterday @ 3:04 PM
Points: 801, Visits: 715
To be technical, it is not a DMV you are looking for but a catalog view. (The difference is that a catalog shows information persisted in the system catalog, while the a exposes internal data inside the SQL Server executable, but which is not stored on disk directly.)

Here is a query:

SELECT t.name, ds.name
FROM sys.tables t
JOIN sys.data_spaces ds ON t.filestream_data_space_id = ds.data_space_id
ORDER BY t.name



Erland Sommarskog, SQL Server MVP, www.sommarskog.se
Post #1496609
Posted Friday, September 20, 2013 1:43 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Today @ 2:24 AM
Points: 39, Visits: 332
Erland, thank you very much.
I wanted that exactly.



Post #1496735
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse