Friday, February 24, 2012

Add data file to filegroup

I tried to add new file to new filegroup:
Created a new database in ER, successful.
Then, right click this new database, select propertied.
Goto Data Files tab, add a new data file at the second row and select a new
Location. Set Space Allocated, BUT I cannot set Filegroup to Table, it has
the only option PRIMARY.Alan
Here's a way I am doing
CREATE DATABASE test
GO
ALTER DATABASE test SET RECOVERY FULL
ALTER DATABASE test
ADD FILEGROUP ww_Group
GO
ALTER DATABASE test
ADD FILE
( NAME = ww,
FILENAME = 'D:\wwdat1.ndf',
SIZE = 5MB,
MAXSIZE = 100MB,
FILEGROWTH = 5MB)
TO FILEGROUP ww_Group
create table test..test(id int identity) on [primary]
create table test..test_GR(id int identity) on ww_Group
"Alan" <NOSPAMalan_pltse@.yahoo.com.au> wrote in message
news:uM8cNRqqEHA.3252@.TK2MSFTNGP14.phx.gbl...
> I tried to add new file to new filegroup:
> Created a new database in ER, successful.
> Then, right click this new database, select propertied.
> Goto Data Files tab, add a new data file at the second row and select a
new
> Location. Set Space Allocated, BUT I cannot set Filegroup to Table, it has
> the only option PRIMARY.
>

No comments:

Post a Comment