views:

55

answers:

1

How to configure a database so that filestream data is stored on a non local path?

To enable filestream at db level I do first:

ALTER DATABASE MyDatabase ADD
FILEGROUP FileStreamFileGroup CONTAINS FILESTREAM;
GO

Then:

ALTER DATABASE MyDatabase ADD FILE (
       NAME = MyDatabaseFileStreamFile,
       FILENAME = 'c:\Test')
TO FILEGROUP FileStreamFileGroup ;
GO

Now instead of

c:\Test

I want to set a network path, for example:

\\Fileserver\Test

but this doesn't work:

ALTER DATABASE MyDatabase ADD FILE (
       NAME = MyDatabaseFileStreamFile,
       FILENAME = '\\Fileserver\Test') -- THIS IS NOT ACCEPTED
TO FILEGROUP FileStreamFileGroup ;
GO

How to achieve the desired result?

+1  A: 

This is not supported. Although filestream data may be accessed remotely by clients, it must be local with respect to the Sql Server instance hosting it.

Pawel Marciniak
So what should I do if I have huge amounts of data and I want to host it in another machine or in a NAS?
I believe that qualifies as a separate question
Pawel Marciniak
Yes you are right, I asked this question: http://stackoverflow.com/questions/3227499/how-to-manage-huge-amount-of-data-using-filestream-since-only-local-paths-are-sup