![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I get the error: Default FILESTREAM filegroup is not available in database "MyDatabase" How can I solve this problem? |
|
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, ) -- Slides I get the error: Default FILESTREAM filegroup is not available in database "MyDatabase" How can I solve this problem? Thanks, Miguel |
#3
| ||||
| ||||
|
|
A least one FILESTREAM filegroup file is needed in order to use filestream storage. *Also, one of the filestream filegroups needs to be marked as the default if you don't specify FILESTREAM ON clause in your CREATE TABLE. |
|
You can add a FILESTREAM filegroup to you database from SQL Server Management Studio or script. * |
|
Script example (the first FILESTREAM filegroup is the default one): ADD FILEGROUP Bar CONTAINS FILESTREAM; ALTER DATABASE Foo * * ADD FILE ( NAME = N'Bar', * * * * FILENAME = N'C:\Bar' ) TO FILEGROUP [Bar]; |
|
Note that you also need a ROWGUIDCOL to your uniqueidentifier definition. |
#4
| ||||
| ||||
|
|
A least one FILESTREAM filegroup file is needed in order to use filestream storage. Also, one of the filestream filegroups needs to be marked as the default if you don't specify FILESTREAM ON clause in your CREATE TABLE. |
|
You can add a FILESTREAM filegroup to you database from SQL Server Management Studio or script. |
|
Script example (the first FILESTREAM filegroup is the default one): ADD FILEGROUP Bar CONTAINS FILESTREAM; ALTER DATABASE Foo ADD FILE ( NAME = N'Bar', FILENAME = N'C:\Bar' ) TO FILEGROUP [Bar]; |
|
Note that you also need a ROWGUIDCOL to your uniqueidentifier definition. |
#5
| |||||
| |||||
|
|
I have two tables. Posts and Slides, where both ones have a column named File of type file stream. How can I associated a file group named Posts to table Posts and another one named Slides to table Slides? Shouldn't I do this? |
|
And do I need to specify the path? Can I define the path as the same as the database file is located? |
|
If not then I will need to change this either using the database on my computer or on my hosting server. |
|
Note that you also need a ROWGUIDCOL to your uniqueidentifier definition. Should I add this to all my other tables? And shoulc I have clustered on my IDs? |
|
And don't I also need to do the following for File Stream? exec [sp_filestream_configure] @enable_level = 3; |
#6
| |||||
| |||||
|
|
How can I associated a file group named Posts to table Posts and another one named Slides to table Slides? Shouldn't I do this? |
|
A least one FILESTREAM filegroup file is needed in order to use filestream storage. Also, one of the filestream filegroups needs to be marked as the default if you don't specify FILESTREAM ON clause in your CREATE TABLE. |
|
You can add a FILESTREAM filegroup to you database from SQL Server Management Studio or script. |
|
Script example (the first FILESTREAM filegroup is the default one): ADD FILEGROUP Bar CONTAINS FILESTREAM; ALTER DATABASE Foo ADD FILE ( NAME = N'Bar', FILENAME = N'C:\Bar' ) TO FILEGROUP [Bar]; |
|
Note that you also need a ROWGUIDCOL to your uniqueidentifier definition. |
#7
| |||
| |||
|
|
I think Tibor has answered most your questions. How can I associated a file group named Posts to table Posts and another one named Slides to table Slides? Shouldn't I do this? You can either use the same filegroup or separate ones for the filestream data in both tables. *Personally, I would use the same (default) filegroup unless you have a reason to do otherwise. *It might be appropriate to segregate the filegroup storage if you have different recovery (read-only vs. read-write) or performance (fast vs slow disks) requirements. -- Hope this helps. Dan Guzman SQL Server MVPhttp://weblogs.sqlteam.com/dang/ "shapper" <mdmo... (AT) gmail (DOT) com> wrote in message news:f6c09e17-5f9d-49ef-a1ed-d129170b1ec6 (AT) c14g2000yqm (DOT) googlegroups.com... On Aug 1, 2:37 pm, "Dan Guzman" <guzma... (AT) nospam-online (DOT) sbcglobal.net wrote: A least one FILESTREAM filegroup file is needed in order to use filestream storage. Also, one of the filestream filegroups needs to be marked as the default if you don't specify FILESTREAM ON clause in your CREATE TABLE. I added the following: add filegroup Slides contains filestream; So Slides is the default file group. You can add a FILESTREAM filegroup to you database from SQL Server Management Studio or script. I am using Script Script example (the first FILESTREAM filegroup is the default one): ADD FILEGROUP Bar CONTAINS FILESTREAM; ALTER DATABASE Foo ADD FILE ( NAME = N'Bar', FILENAME = N'C:\Bar' ) TO FILEGROUP [Bar]; I don't understand this. FileGroup will be a folder where the data is saved, correct? I have two tables. Posts and Slides, where both ones have a column named File of type file stream. How can I associated a file group named Posts to table Posts and another one named Slides to table Slides? Shouldn't I do this? And do I need to specify the path? Can I define the path as the same as the database file is located? If not then I will need to change this either using the database on my computer or on my hosting server. Note that you also need a ROWGUIDCOL to your uniqueidentifier definition. Should I add this to all my other tables? And shoulc I have clustered on my IDs? And don't I also need to do the following for File Stream? exec [sp_filestream_configure] @enable_level = 3; go |
#8
| |||
| |||
|
|
On Aug 1, 6:23*pm, "Dan Guzman" <guzma... (AT) nospam-online (DOT) sbcglobal.net wrote: I think Tibor has answered most your questions. How can I associated a file group named Posts to table Posts and another one named Slides to table Slides? Shouldn't I do this? You can either use the same filegroup or separate ones for the filestream data in both tables. *Personally, I would use the same (default) filegroup unless you have a reason to do otherwise. *It might be appropriate to segregate the filegroup storage if you have different recovery (read-only vs. read-write) or performance (fast vs slow disks) requirements. -- Hope this helps. Dan Guzman SQL Server MVPhttp://weblogs.sqlteam.com/dang/ "shapper" <mdmo... (AT) gmail (DOT) com> wrote in message news:f6c09e17-5f9d-49ef-a1ed-d129170b1ec6 (AT) c14g2000yqm (DOT) googlegroups.com.... On Aug 1, 2:37 pm, "Dan Guzman" <guzma... (AT) nospam-online (DOT) sbcglobal.net wrote: A least one FILESTREAM filegroup file is needed in order to use filestream storage. Also, one of the filestream filegroups needs to be marked asthe default if you don't specify FILESTREAM ON clause in your CREATE TABLE. I added the following: add filegroup Slides contains filestream; So Slides is the default file group. You can add a FILESTREAM filegroup to you database from SQL Server Management Studio or script. I am using Script Script example (the first FILESTREAM filegroup is the default one): ADD FILEGROUP Bar CONTAINS FILESTREAM; ALTER DATABASE Foo ADD FILE ( NAME = N'Bar', FILENAME = N'C:\Bar' ) TO FILEGROUP [Bar]; I don't understand this. FileGroup will be a folder where the data is saved, correct? I have two tables. Posts and Slides, where both ones have a column named File of type file stream. How can I associated a file group named Posts to table Posts and another one named Slides to table Slides? Shouldn't I do this? And do I need to specify the path? Can I define the path as the same as the database file is located? If not then I will need to change this either using the database on my computer or on my hosting server. Note that you also need a ROWGUIDCOL to your uniqueidentifier definition. Should I add this to all my other tables? And shoulc I have clustered on my IDs? And don't I also need to do the following for File Stream? exec [sp_filestream_configure] @enable_level = 3; go Hello, I am using the following: add filegroup Files contains filestream; alter database Badb add 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 |
#9
| |||
| |||
|
|
On Aug 1, 11:15*pm, shapper <mdmo... (AT) gmail (DOT) com> wrote: On Aug 1, 6:23*pm, "Dan Guzman" <guzma... (AT) nospam-online (DOT) sbcglobal.net wrote: I think Tibor has answered most your questions. How can I associated a file group named Posts to table Posts and another one named Slides to table Slides? Shouldn't I do this? You can either use the same filegroup or separate ones for the filestream data in both tables. *Personally, I would use the same (default) filegroup unless you have a reason to do otherwise. *It might be appropriate to segregate the filegroup storage if you have different recovery (read-only vs. read-write) or performance (fast vs slow disks) requirements. -- Hope this helps. Dan Guzman SQL Server MVPhttp://weblogs.sqlteam.com/dang/ "shapper" <mdmo... (AT) gmail (DOT) com> wrote in message news:f6c09e17-5f9d-49ef-a1ed-d129170b1ec6 (AT) c14g2000yqm (DOT) googlegroups.com.... On Aug 1, 2:37 pm, "Dan Guzman" <guzma... (AT) nospam-online (DOT) sbcglobal.net wrote: A least one FILESTREAM filegroup file is needed in order to use filestream storage. Also, one of the filestream filegroups needs to be marked as the default if you don't specify FILESTREAM ON clause in your CREATE TABLE. I added the following: add filegroup Slides contains filestream; So Slides is the default file group. You can add a FILESTREAM filegroup to you database from SQL Server Management Studio or script. I am using Script Script example (the first FILESTREAM filegroup is the default one): ADD FILEGROUP Bar CONTAINS FILESTREAM; ALTER DATABASE Foo ADD FILE ( NAME = N'Bar', FILENAME = N'C:\Bar' ) TO FILEGROUP [Bar]; I don't understand this. FileGroup will be a folder where the data is saved, correct? I have two tables. Posts and Slides, where both ones have a column named File of type file stream. How can I associated a file group named Posts to table Posts and another one named Slides to table Slides? Shouldn't I do this? And do I need to specify the path? Can I define the path as the same as the database file is located? If not then I will need to change this either using the database on my computer or on my hosting server. Note that you also need a ROWGUIDCOL to your uniqueidentifier definition. Should I add this to all my other tables? And shoulc I have clustered on my IDs? And don't I also need to do the following for File Stream? exec [sp_filestream_configure] @enable_level = 3; go Hello, I am using the following: add filegroup Files contains filestream; alter database Badb add 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 Do you have an 'ALTER DATABASE dbname' statement 'ADD FILEGROUP'? |
#10
| |||
| |||
|
|
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. |
|
On Aug 1, 11:15 pm, shapper <mdmo... (AT) gmail (DOT) com> wrote: On Aug 1, 6:23 pm, "Dan Guzman" <guzma... (AT) nospam-online (DOT) sbcglobal.net wrote: I think Tibor has answered most your questions. How can I associated a file group named Posts to table Posts and another one named Slides to table Slides? Shouldn't I do this? You can either use the same filegroup or separate ones for the filestream data in both tables. Personally, I would use the same (default) filegroup unless you have a reason to do otherwise. It might be appropriate to segregate the filegroup storage if you have different recovery (read-only vs. read-write) or performance (fast vs slow disks) requirements. -- Hope this helps. Dan Guzman SQL Server MVPhttp://weblogs.sqlteam.com/dang/ "shapper" <mdmo... (AT) gmail (DOT) com> wrote in message news:f6c09e17-5f9d-49ef-a1ed-d129170b1ec6 (AT) c14g2000yqm (DOT) googlegroups.com... On Aug 1, 2:37 pm, "Dan Guzman" <guzma... (AT) nospam-online (DOT) sbcglobal.net wrote: A least one FILESTREAM filegroup file is needed in order to use filestream storage. Also, one of the filestream filegroups needs to be marked as the default if you don't specify FILESTREAM ON clause in your CREATE TABLE. I added the following: add filegroup Slides contains filestream; So Slides is the default file group. You can add a FILESTREAM filegroup to you database from SQL Server Management Studio or script. I am using Script Script example (the first FILESTREAM filegroup is the default one): ADD FILEGROUP Bar CONTAINS FILESTREAM; ALTER DATABASE Foo ADD FILE ( NAME = N'Bar', FILENAME = N'C:\Bar' ) TO FILEGROUP [Bar]; I don't understand this. FileGroup will be a folder where the data is saved, correct? I have two tables. Posts and Slides, where both ones have a column named File of type file stream. How can I associated a file group named Posts to table Posts and another one named Slides to table Slides? Shouldn't I do this? And do I need to specify the path? Can I define the path as the same as the database file is located? If not then I will need to change this either using the database on my computer or on my hosting server. Note that you also need a ROWGUIDCOL to your uniqueidentifier definition. Should I add this to all my other tables? And shoulc I have clustered on my IDs? And don't I also need to do the following for File Stream? exec [sp_filestream_configure] @enable_level = 3; go Hello, I am using the following: add filegroup Files contains filestream; alter database Badb add 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 Do you have an 'ALTER DATABASE dbname' statement 'ADD FILEGROUP'? |
![]() |
| Thread Tools | |
| Display Modes | |
| |