FILESTREAM data cannot be placed on an empty filegroup 解决办法

简介:

如果你也遇到了FILESTREAM data cannot be placed on an empty filegroup 这个错误。

你去google搜索,得到的第一条是应该在这里。答案是:

 

Your script are missing three things:

1) A USE statement for the database.

2) An ALTER DATABASE statement to add a file to the FILESTREAM file group. For instance:

ADD FILE (NAME = filestream_data,

          FILENAME = 'c:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\PreviewIntegration_data')


Beware that the file name should be on a single line.
             

3) A ROWGUIDCOL in the table:

guid uniqueidentifier NOT NULL UNIQUE ROWGUIDCOL,

 

意思是需要

1. Use [你的数据库名]

2. 修改数据库

   完整的应该是这样的(这里只涉及到了修改数据库的file和filegroup部分

复制代码
ExpandedBlockStart.gif 语法
 1  ALTER   DATABASE  database_name 
 2  {
 3       < add_or_modify_files >
 4     |   < add_or_modify_filegroups >
 5  }
 6  [ ; ]
 7 
 8  < add_or_modify_files > :: =
 9  {
10       ADD   FILE   < filespec >   [  ,...n  ]  
11           [  TO FILEGROUP { filegroup_name }  ]
12     |   ADD   LOG   FILE   < filespec >   [  ,...n  ]  
13     |  REMOVE  FILE  logical_file_name 
14     |  MODIFY  FILE   < filespec >
15  }
16 
17  < filespec > :: =  
18  (
19      NAME  =  logical_file_name  
20       [  , NEWNAME = new_logical_name  ]  
21       [  , FILENAME = {'os_file_name' | 'filestream_path' }  ]  
22       [  , SIZE = size [ KB | MB | GB | TB  ]  ] 
23       [  , MAXSIZE = { max_size [ KB | MB | GB | TB  ]   |  UNLIMITED } ] 
24       [  , FILEGROWTH = growth_increment [ KB | MB | GB | TB| %  ]  ] 
25       [  , OFFLINE  ]
26 
27 
28  < add_or_modify_filegroups > :: =
29  {
30       |   ADD  FILEGROUP  filegroup_name  
31           [  CONTAINS FILESTREAM  ]
32       |  REMOVE FILEGROUP  filegroup_name  
33       |  MODIFY FILEGROUP  filegroup_name
34          {  < filegroup_updatability_option >  
35           |   DEFAULT
36           |  NAME  =  new_filegroup_name 
37          }
38  }
39  < filegroup_updatability_option > :: =
40  {
41      { READONLY  |  READWRITE } 
42       |  { READ_ONLY  |  READ_WRITE }
43  }
44 
复制代码

 

 你看了这个语法,再看前面给出来的答案你就会明白那样子的添加文件并没有和库的FileStream有任何的关联。所以应该是这样的:

ALTER   DATABASE   [ 你的数据库 ]

add   FILE (name =  文件逻辑名,
FILENAME 
=  文件全名)  TO  FILEGROUP 你的FileStream名

 

也就是以上的例子需要在后面加上To FileGroup来指明文件添加到哪个FileStream下。

到这里基本的上主要的问题就都解决掉了。

剩下的按照最初的解决方一一对照修正就可以解决了。

欢迎加群互相学习,共同进步。QQ群:iOS: 58099570 | Android: 330987132 | Go:217696290 | Python:336880185 | 做人要厚道,转载请注明出处!http://www.cnblogs.com/sunshine-anycall/archive/2010/07/10/1774948.html
相关文章
|
6月前
Tp5 SplFileObject::__construct(/tmp/phpvuOdFd): failed to open stream: No such file or director解决方法
Tp5 SplFileObject::__construct(/tmp/phpvuOdFd): failed to open stream: No such file or director解决方法
|
2月前
报错:cannot read properties of undefined(reading ‘forEach‘)
报错:cannot read properties of undefined(reading ‘forEach‘)
报错:cannot read properties of undefined(reading ‘forEach‘)
|
9月前
|
JavaScript
Cannot read properties of undefined (reading ‘push‘)“ 报错 解决方法
一.首先这个报错的大致意思就是不能读取这个push方法,顾名思义就是使用这个方法的变量不是一个数组
1103 0
base64转图片的时候Can't read input file!
如果不去掉编码中的图片头信息,就会报Can't read input file!。 一开始还以为是文件路径格式有问题,然后看了看我之前用的,就有一个区别就是没有去头信息。
在使用xlsx.js导入文件报错Error: Cannot read properties of undefined (reading ‘read‘) at FileReader.read
在使用xlsx.js导入文件报错Error: Cannot read properties of undefined (reading ‘read‘) at FileReader.read
在使用xlsx.js导入文件报错Error: Cannot read properties of undefined (reading ‘read‘) at FileReader.read
Can‘t read file : End of file found 文件:txn_current、current svn无法正常读取文件
Can‘t read file : End of file found 文件:txn_current、current svn无法正常读取文件
Can‘t read file : End of file found 文件:txn_current、current svn无法正常读取文件
open函数: 可以帮助我们获取文件对象 内置函数 open(file, mode='r', buffering=-1, encoding=None, errors=None
open函数: 可以帮助我们获取文件对象 内置函数 open(file, mode='r', buffering=-1, encoding=None, errors=None
E297: Write error in swap file
当我使用vim编辑一个常用的配置文件的时候出现一个错误: E297: Write error in swap file 然后上网查找原因,说是磁盘空间不足,于是我就查看一下机器磁盘空间使用情况: sht-sgmhadoopdn-02:postgres:/usr/loca...
2411 0