| Author |
Topic |
|
shapper
Constraint Violating Yak Guru
450 Posts |
Posted - 2009-08-01 : 07:58:50
|
| Hello,I am creating a table on a SQL 2008 database as follows:create table Slides ( ID uniqueidentifier not null constraint PK_Slide primary key clustered, [File] varbinary(max) filestream default(0x), [Name] nvarchar(100) null, ) -- SlidesI get the error:Default FILESTREAM filegroup is not available in database "MyDatabase"How can I solve this problem?Thanks,Miguel |
|
|
beyondrelational
Starting Member
6 Posts |
Posted - 2009-08-01 : 10:37:03
|
| is your database FILESTREAM enabled? Before you can create a table with FILESTREAM columns, the database should be FILESTREAM enabled. The database should have a file group with FILESTREAM attribute.http://blog.beyondrelational.com |
 |
|
|
shapper
Constraint Violating Yak Guru
450 Posts |
Posted - 2009-08-01 : 11:10:31
|
I added the following:exec [sp_filestream_configure] @enable_level = 3;goadd filegroup Posts contains filestream;goalter database MyDatabase add file ( name = N'????', filename = N'C:\????' ) TO filegroup [Posts]; go I am not sure if this is the way and I still have some problems.On my database I have two tables that contains each one a column for a file: Slides and Posts. In both tables the file column is simply named File.Shouldn't I create two filegroups: Slides and Posts.One for Slides files and another for Posts files?How can I do that?I don't understand very well the Add File setup.And can't I define the path of the FilesGroups as the same where the Database file is located?I am asking this because it would be easier to move the database from my computer to my hosting server ... I think.Thanks,Miguel |
 |
|
|
beyondrelational
Starting Member
6 Posts |
Posted - 2009-08-01 : 12:08:51
|
| What is the issue you have after adding the FILESTREAM filegroup?I see that your CREATE table statement is missing the ROWGUIDCOL attribute in the ID column. I modified it to "ID uniqueidentifier not null ROWGUIDCOL constraint PK_Slide primary key clustered" and I am able to create the table without any problem.http://beyondrelational.com/blogs/jacob/ |
 |
|
|
shapper
Constraint Violating Yak Guru
450 Posts |
Posted - 2009-08-01 : 14:15:55
|
Hello,I am using the following:add filegroup Files contains filestream;alter database Badbadd file ( name = N'Files', filename = N'c:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA' ) to filegroup [Files];create table Slides ( ID uniqueidentifier not null rowguidcol constraint PK_Slide primary key clustered, Active bit not null default 0, [File] varbinary(max) filestream default(0x), [Name] nvarchar(100) null, Url nvarchar(400) null) -- Slides And I always get the error:Incorrect syntax near 'filegroup'.What am I missing?I checked my code but I can't find the error.Thank You,Miguel |
 |
|
|
beyondrelational
Starting Member
6 Posts |
Posted - 2009-08-01 : 14:43:59
|
| You should have an 'ALTER DATABASE dbname ' Before the 'ADD FILEGROUP' clause.http://beyondrelational.com/blogs/jacob/ |
 |
|
|
shapper
Constraint Violating Yak Guru
450 Posts |
Posted - 2009-08-01 : 15:43:10
|
| Yes I also used that:alter database Badbadd filegroup Files contains filestream;alter database Badbadd file ( name = N'Files', filename = N'c:\Program Files\MicrosoftSQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA' )to filegroup [Files];And I get another error:FILESTREAM feature is disabled.Invalid filegroup 'Files' specified.Default FILESTREAM filegroup is not available in database 'Badb'.No rows affected. |
 |
|
|
beyondrelational
Starting Member
6 Posts |
|
|
eralper
Yak Posting Veteran
66 Posts |
Posted - 2011-07-28 : 05:07:06
|
| This error is indicating a database whose database files are not configured correctly for filestreamPlease check the following article [url]http://www.kodyaz.com/t-sql/default-filestream-filegroup-is-not-available-in-database.aspx[/url] how you can configure filegroups and database files.-------------Eralperhttp://www.kodyaz.com |
 |
|
|
|