Changing FILESTREAM Settings

原创 2012年03月22日 11:15:26

By default, FILESTREAM is disabled. Before starting to use it on a SQL Server instance, FILESTREAM needs to be enabled on the instance. The FILESTREAMSettings class provides an EnableFILESTREAM method that accepts two parameters:
EnableFILESTREAM(System.UInt32 AccessLevel, System.String ShareName)

Note: FILESTREAM Access Level Values
0----Disables FILESTREAM support for this instance
1----Enables FILESTREAM for Transact-SQL access
2----Enables FILESTREAM for Transact-SQL and local file system access
3----Enables FILESTREAM for Transact-SQL, local file system access, and remote file system access

 

To enable FILESTREAM for Transact-SQL and local file system access(EnableFileStream.ps1):

# . for the local computer. If you want to connect to a remote machine, specify the machine name here.
$strComputer = "."
# Name of the targeted SQL Server instance. Here the default instance is targeted.For a named instance INSTANCE1, use "INSTANCE1".
$strInstanceName = "MSSQLSERVER"
$wmi=Get-WmiObject -computerName $strComputer -namespace root\Microsoft\SqlServer\ComputerManagement10 `
-class FILESTREAMSettings -filter "InstanceName=’$strInstanceName’"
# Prints out the AccessLevel property before changing it.
Write-Host "The access level of FILESTREAM before the change is set to"
$wmi.AccessLevel ", and the file share name is " $wmi.ShareName
$wmi.EnableFILESTREAM(2, ‘MSSQLSERVER’) | Out-Null
$wmi=Get-WmiObject -computerName $strComputer -namespace root\Microsoft\SqlServer\ComputerManagement10 `
-class FILESTREAMSettings -filter "InstanceName=’$strInstanceName’"
# Confirm the AccessLevel property has been set.
Write-Host "The access level of FILESTREAM after the change is set to"
$wmi.AccessLevel ", and the file share name is " $wmi.ShareName

 

Note that you still need to restart the SQL Server instance and reconfigure the server option in SSMS to fully enable FILESTREAM. For example, run the following statement in SSMS to enable FILESTREAM for Transact-SQL and Win32 streaming access:
EXEC sp_configure filestream_access_level, 2
RECONFIGURE

 

 

 

FileStream&StreamWriter

  • 2011年12月21日 09:36
  • 16KB
  • 下载

数据仓库缓慢变化维(Slow changing demenison) 的实现方案

目录   缓慢变化维解决方案 1   参考文档:Wikipedia 2   一.新数据覆盖旧数据 3   二.保存多条记录,并添加字段加以区分 3   三.不同字段保存不同值 4   ...
  • ffffffs
  • ffffffs
  • 2012年07月25日 14:23
  • 1156

SQL Server 2008 FileStream

  • 2012年08月16日 14:12
  • 751KB
  • 下载

POJ 3373 Changing Digits (记忆化搜索)

这道题是考试的时候遇到的,分析的时候

filestream读文件 c#

  • 2012年05月31日 16:12
  • 43KB
  • 下载

个读取速度超快的FileStream

  • 2011年04月01日 21:41
  • 4KB
  • 下载

每天都应该有一点进步,changing! 规划!奋三强二,五后出 ,三十黎 or no 黎!

每天都应该尝试去总结在工作中学习到的新知识点,不但能总结下工作,而且还能巩固下这些知识点,当沉淀到一定量的时候自然而然就是一种不可小窥的财富!从今天就开始每天下班后回家就总结当日工作中涉及到的一些新知...
  • BackMe
  • BackMe
  • 2011年07月08日 09:05
  • 1386
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:Changing FILESTREAM Settings
举报原因:
原因补充:

(最多只允许输入30个字)