Enabling FileStream
This recipe explains how to enable FileStream in SQL Server.
How to do it...
Let's take a look at the steps to enable FileStream in SQL Server:
Open PowerShell ISE as an administrator.
Import the
SQLPS
module as follows:#import SQL Server module Import-Module SQLPS -DisableNameChecking
Add the following script and run it:
$instanceName = "localhost" $server = New-Object -TypeName Microsoft.SqlServer.Management.Smo.Server -ArgumentList $instanceName <# These are the FileStreamLevel Enumeration values: Disabled TSqlAccess TSqlFullFileSystemAccess TSqlLocalFileSystemAccess #> #enable $server.Configuration.FilestreamAccessLevel.ConfigValue = [Microsoft.SqlServer.Management.Smo.FileStreamLevel]::TSqlLocalFileSystemAccess $server.Alter()
How it works...
If you've ever had to maintain folders with images or videos in them, and you had to reference the file paths (or URLs) and other metadata from SQL Server, you might have encountered challenges in keeping these two synchronized...