Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 328
  • Last Modified:

Adding a filegroup and setting it as default in SQL Server

Is it possible to set a new filegroup as default somewhere within this code?

ALTER DATABASE TestDB
ADD FILEGROUP USER_DATA;
GO

Or can it only be done separately with the MODIFY keyword?

ALTER DATABASE [TestDB] MODIFY FILEGROUP [USER_DATA] DEFAULT
0
TimHudspith
Asked:
TimHudspith
  • 3
1 Solution
 
Raja Jegan RSQL Server DBA & ArchitectCommented:
In order to set a new Filegroup as default, it requires three steps(you missed the second one)
1. Create a Filegroup
2. Create a File into that Filegroup.
3. Set the Filegroup as default.

And hence it needs to be done in this order as three steps and not in a single command.
0
 
Raja Jegan RSQL Server DBA & ArchitectCommented:
I hope my answer clarified you completely and deserve a A Grade and justify why it was given a B Grade, also let me know if you require more details so that I can assist you..
0
 
TimHudspithAuthor Commented:
How do I change it?
0
 
Raja Jegan RSQL Server DBA & ArchitectCommented:
Hi Tim,

I've requested Moderators to help on this perspective.
Thanks for responding..

Hi Moderators,

Kindly do the needful.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now