September 18, 2013 at 9:07 am
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.
September 18, 2013 at 3:47 pm
I don't really understand your question. Can you elaborate?
[font="Times New Roman"]Erland Sommarskog, SQL Server MVP, www.sommarskog.se[/font]
September 19, 2013 at 12:46 am
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.
September 19, 2013 at 3:22 pm
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
[font="Times New Roman"]Erland Sommarskog, SQL Server MVP, www.sommarskog.se[/font]
September 20, 2013 at 1:43 am
Erland, thank you very much.
I wanted that exactly.
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy