views:

152

answers:

2

Hello.

Is there a way to retrieve the filename for filegroup filestream?

I try to create a new database in tsql, i need to create the filestream path for the database.

but i dont know the path of the folder to put the filestream in. So i try to get the filename path of another database on the same server to configure the new database.

Is there an easier way?

Thanks

+1  A: 
SELECT * FROM sys.database_files

will show you all the database files in the current database - one of them is the one used for FILESTREAM storage, and should tell you what directory it's using.

SELECT physical_name FROM sys.database_files WHERE type = 2

Marc

marc_s
The only informations this query return it's the name, dsata_space_id, type, type_desc, isdefault, filegroup_guid, log_filegroup_id and is_read_only column ... but no path
Cédric Boivin
Sorry, wrong view - you need to look at sys.database_files
marc_s
Exactly what i want !thanks
Cédric Boivin
A: 

Try querying a field storing a filestream in a table of the other DB like this

select top 1 fieldname.PathName from tablename

klabranche
This method not working
Cédric Boivin
You should be able to:http://msdn.microsoft.com/en-us/library/bb895239.aspx
klabranche