Solved

Adding a filegroup and setting it as default in SQL Server

Posted on 2013-12-29
5
320 Views
Last Modified: 2013-12-30
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
Comment
Question by:TimHudspith
  • 3
5 Comments
 
LVL 57

Accepted Solution

by:
Raja Jegan R earned 500 total points
ID: 39745592
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
 
LVL 57

Expert Comment

by:Raja Jegan R
ID: 39745837
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
 

Author Comment

by:TimHudspith
ID: 39746201
How do I change it?
0
 
LVL 57

Expert Comment

by:Raja Jegan R
ID: 39747600
Hi Tim,

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

Hi Moderators,

Kindly do the needful.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question