Saturday, September 17, 2016

Enable Filestream at SQL Server

  1. right-click on your server in SSMS's object manager and pick "Properties" then "Advanced" from the dialog which appears and set "FILESTREAM Access Level" under "FILESTREAM" to "Transact-SQL access enabled"
  2. open "SQL Server Configuration Manager" and click on "SQL Server Services" at the left and at the right right-click on "SQL Server (MSSQLSERVER)" and pick "Properties" and then the "FILESTREAM" tab where you should check the checkbox for "Enable FILESTREAM for Transact-SQL access"
  3. open services and restart "SQL Server (MSSQLSERVER)"
  4. you're gonna need some SQL like this...
    USE [master]
    GO
    ALTER DATABASE [Foo] ADD FILEGROUP [Files]
    CONTAINS FILESTREAM
    GO
    ALTER DATABASE [Foo] ADD FILE (Name='Nice_Files',
          FILENAME=N'E:\whatever\Nice_Files') TO FILEGROUP [Files]
    GO

 
 

Addendum: @jdgonzalez mentions: @jaeschke one clarification. The file you list is actually a folder.

No comments:

Post a Comment