file connect,,linking datafile to datafile group

  • I have a problem

    how i can do;

    connect file = test3 data FILE to testgroup2 FILEGROUP

    and this

    connect file = test4 data FILE to testgroup2 FILEGROUP

    LITTLE DETAIL ==>

    ------------------

    ALTER DATABASE test

    ADD FILE

    (NAME = test3,

    FILENAME = 'c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\test3.ndf',

    SIZE = 5MB, MAXSIZE=100MB, FILEGROWTH = 5MB)

    GO

    ---------------------

    ALTER DATABASE test

    ADD FILE

    (NAME = test4,

    FILENAME = 'c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\test4.ndf',

    SIZE = 5MB, MAXSIZE=100MB, FILEGROWTH = 5MB)

    GO

    ----------------------

    ALTER DATABASE test

    ADD FILEGROUP testgrup2

    GO

  • what error you are getting? while executing above scripts.

  • i write this scripts.and i got these files (test3.ndf and test4.ndf) (testgrup2) FILEGROUP

    and i want to connect these files (test3.ndf-test4.ndf) to testgrup2 FILEGROUP.

    thanks 🙂

  • johnny1walker (3/9/2012)


    I have a problem

    how i can do;

    connect file = test3 data FILE to testgroup2 FILEGROUP

    and this

    connect file = test4 data FILE to testgroup2 FILEGROUP

    LITTLE DETAIL ==>

    ------------------

    ALTER DATABASE test

    ADD FILE

    (NAME = test3,

    FILENAME = 'c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\test3.ndf',

    SIZE = 5MB, MAXSIZE=100MB, FILEGROWTH = 5MB)

    GO

    ---------------------

    ALTER DATABASE test

    ADD FILE

    (NAME = test4,

    FILENAME = 'c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\test4.ndf',

    SIZE = 5MB, MAXSIZE=100MB, FILEGROWTH = 5MB)

    GO

    ----------------------

    ALTER DATABASE test

    ADD FILEGROUP testgrup2

    GO

    You need to create the filegroup first and then add the new files to the new filegroup. Remove the files and carry out the following

    Create filegroup

    ALTER DATABASE test ADD FILEGROUP testgroup2

    GO

    Add the new files to the filegroup

    ALTER DATABASE test

    ADD FILE

    (NAME = test3,

    FILENAME = 'c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\test3.ndf',

    SIZE = 5MB, MAXSIZE=100MB, FILEGROWTH = 5MB),

    (NAME = test4,

    FILENAME = 'c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\test4.ndf',

    SIZE = 5MB, MAXSIZE=100MB, FILEGROWTH = 5MB)

    TO FILEGROUP testgroup2

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • thank you very much 🙂

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply