Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2012
    Posts
    15

    Post Unanswered: 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

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Code:
    ALTER DATABASE test
       ADD FILEGROUP testgroup2
    GO
    
    ------------------
    
    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
       ) TO FILEGROUP testgroup2
    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
       ) TO FILEGROUP testgroup2
    GO
    
    ----------------------
    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  3. #3
    Join Date
    Mar 2012
    Posts
    15

    Thumbs up

    thanks a lot but i have test3 and test4 data file
    Last edited by johnny1walker; 03-10-12 at 09:17.

  4. #4
    Join Date
    Mar 2012
    Posts
    15

    Lightbulb

    sorryThis is not exactly a problem.you write "ADD FILE name=test3" and "ADD FILE name=test4"
    we have test3.ndf and test4.ndf data file.(dont add file)alone connect this files

  5. #5
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    You can't move an existing file to a different filegroup, see Creating Filegroups

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  6. #6
    Join Date
    Mar 2012
    Posts
    15

    Thumbs up

    thank you very much

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •