4

When a database is created a file group with a data file is created by default. Is it possible to add more than data file into a primary file group.

1
  • Please, be more specific. Commented Sep 22, 2017 at 12:07

1 Answer 1

3

To add an data-file to primary filegroup:

USE [master]
GO
ALTER DATABASE [your_database] 
ADD FILE 
    (NAME = N'logical_name', 
    FILENAME = N'C:\my_data.mdf', -- <--Path to physical file
    SIZE = 1GB, 
    FILEGROWTH = 100MB
) 
TO FILEGROUP [PRIMARY]
Sign up to request clarification or add additional context in comments.

2 Comments

I need to verify this
You can add files to the filegroup "PRIMARY" the way you can add files to any other filegroup. You can delete these additional files again (when they are empty) like in any other filegroup. But you cannot delete the filegroup "PRIMARY". It is also not possible to rename it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.