Reputation: 99
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.
Upvotes: 4
Views: 8006
Reputation: 543
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]
Upvotes: 3