Solved

Adding a filegroup and setting it as default in SQL Server

Posted on 2013-12-29
5
321 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

730 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