5

I have a server running SQL Server 2012 with Multiple Filestream containers on a single table.

I need to split one of the existing filestream containers into two parts by creating a new filestream container and moving the data across.

How can reliably move content between filestream containers?

I have the first container set to not grow any further but how can I move the files to another container without writing to a whole new table? Is there a way to do an UPDATE statement that will cause SQL Server to write the file to disk again? - I have thought of appending an additional byte of data and then removing it afterwards to make SQL Server write the content as new files, but is there a better way?

1

According to Paul Randal (who is as reliable as they come) there is no simple way to do this and you essentially have to recreate the table in a new filegroup that is pointed to your new filestream location. The link is there so you can see for yourself, but this looks like the only real alternative. It is not an ideal one, obviously but it should get you the end result that you need. But not in a simple fashion, I am sorry to say.

  • Despite what your second link says, moving the entire filestream folder is very simple, you detatch the database, move the filestream content container and then attach it at the new location. – Seph Aug 13 '15 at 10:28
  • I am looking for a way to move files between containers when full, I believe it should be possible to move them by updating the content which would cause a new file to be created (and the existing storage was full) as the existing file will only be removed after a database log backup has been performed – Seph Aug 13 '15 at 10:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.