Questions tagged [filegroup]

A filegroup is a named collection of SQL Server database objects and files used for allocation and administration purposes.

SQL Server databases can store their data in one or more filegroups. There is always a "primary" filegroup which is the default storage area. There can be one or more additional "user-defined" filegroups which can also store data. Reasons to use multiple filegroups include:

  • Larger storage capacity
  • Better performance by distributing requests to multiple drives
  • Additional security options

Drawbacks include:

  • Restore, backups, and disaster recovery can be more complicated
  • Additional programming to make sure that all filegroups are used

See File and Filegroups Architecture at MSDN for more information and examples.

93 questions
1
vote
1 answer

Create a Table in different File-group with EF core code-first

I want to create a table in the "Secondary" file group which has been created previously in the SQL Server 2016. I want to create this table with EF core code-first.
1
vote
1 answer

The filegroup cannot be removed because it is not empty Error

I have a file group within a database that has no logical files that cannot be removed. The error message states that the file group is not empty. I have verified that no partitions exist using the queries below. SELECT * FROM…
Robert
  • 43
  • 1
  • 6
1
vote
0 answers

How to add empty file groups at lower and end of a partitioned table in SQL Server without dropping table, partition scheme and partition function?

I have a table called dbo.Audit. I initially had file groups like fgAudit2012, fgAudit2013 upto fgAudit2030 for years 2012 to 2030. The name of my partition function is pfMonthly and name of partition scheme is psMonthly. Each file groups (per year)…
1
vote
1 answer

The ALTER DATABASE statement is not allowed within a trigger

I want to create the file group dynamically when user want to insert data into the table, but SQL Server throws an exception. I know that I can handle this with SQL Server Agent, but if my approach isn't correct please tell me the correct way. Kind…
Ali.Asadi
  • 643
  • 10
  • 16
1
vote
1 answer

Restore filegroup to different database

I have a SQL server database with 5 filegroups i want to backup 2 filegroups(one contains filestream)only and restore them to different existing database.
Hossam Elsagheer
  • 151
  • 1
  • 5
  • 15
1
vote
1 answer

The sql server size file doesn't decrease when i delete my records

I have a table called test i insert 40000 records in it ,I split my database file into two file groups like this : The size of both files based on round robin algorithm increased 160 mb as you can see . after this i delete the data in my table .but…
Ehsan Akbar
  • 6,977
  • 19
  • 96
  • 180
1
vote
2 answers

Efficient way to change the table's filegroup

I have around 300 tables which are located in different partition and now these tables are not in use for such huge data as it was. Now, I am getting space issue time to time and some of but valuable space is occupied by the 150 filegroups that was…
Shushil Bohara
  • 5,556
  • 2
  • 15
  • 32
1
vote
2 answers

Multiple File groups on a Virtual machine for SQL Server

In many of the SQL Server articles it is mentioned that the best practice is to use multiple File group on a physical disk to avoid disk contention and disk spindle issues .So my query are : 1:Does the same theory of having multiple file group …
user3290807
  • 381
  • 1
  • 5
  • 23
1
vote
3 answers

Bringing SQL Server filegroups online

We've experienced an sql injection attack which corrupted our main db. The main db had two partitioned tables into filegroups. The corrupt database entered into Suspect mode, and it's been impossible for us to use. I was able to restore a backup of…
Federico Giust
  • 1,803
  • 4
  • 20
  • 45
1
vote
1 answer

SQL Server Database File Groups on a SAN: Relevant or Not?

I am about to build out a new SQL Server and I was planning to make extensive use of file groups. I expect heavy growth, and heavy read/write to 5 different databases on this server. I was planning on creating 2 additional file groups (one for user…
DMill
  • 303
  • 1
  • 4
  • 16
1
vote
2 answers

Create different filegroup for different Schema

I need to create a filegroup for schema I have in SQL Server. The DB is empty and I just want to create schema and their filegroups. How can I do that?
1
vote
2 answers

Adding file groups to database

How can I add new file groups to an existing database in Microsoft SQL Server 2008? I see that this is not possible through SSMS?
user3365654
  • 71
  • 1
  • 2
1
vote
1 answer

file system not supported error while adding a file to sql filegroup with filestream

hi i am a beginner with sql server 2008, i was trying to add a file to a filegroup so that i an create a table which uses filestream, but i keep getting an errors. here is the code that i am trying: ALTER DATABASE dbtry1 ADD FILEGROUP…
Sneha
  • 121
  • 3
  • 16
1
vote
1 answer

SQL Server 2008 File Write Behaviors

Sort of a 101 question: with multiple files in a user defined filegroup, what is SQL Servers behavior when inserting rows? Round robin? Write until full and move on to the next? I have found some interesting posts regarding tempDb on this subject…
Bruce Krakower
0
votes
2 answers

How to create indexs on a different file of Filegroup

i'm using sqlserver 2008 R2 is there any way to specify that a table index is created on a sencondary file from a filegroup? example: "Primay" Filegroup has 2 files: Catalog.mdf and Indexes.ndf how can i specify that my new index is created on the…
Flavio CF Oliveira
  • 5,235
  • 13
  • 40
  • 63