Asked by: Mamoun Gschrey
asked in category: General Last Updated: 5th April, 2020

How do I move a table to another filegroup in SQL Server?

How I can move table to another filegroup?
  1. Step 1 : Check on which filegroup table is residing: -- Query to check the tables and their current filegroup: SELECT tbl.
  2. Step 2 : Move an existing table / tables to the new Filegroup.
  3. Move the remaining Non-Clustered indexes to secondary filegroup.

Click to see full answer.


Thereof, how do I move a filegroup in SQL Server?

For this, we need to to do the following:

  1. Create a secondary filegroup.
  2. Add data files to the secondary filegroup.
  3. Move the table to the secondary filegroup by moving the clustered index with the primary key constraint.
  4. Move the tables to the secondary filegroup by moving the clustered index without the primary key.

Also Know, what is the use of filegroup in SQL Server? Filegroups are the physical files on your disc volumes that hold SQL Server's data and can be used for backup and administrative management purposes. The first thing to know are what types of files SQL Server uses: Primary Data Files. Secondary Data Files.

Correspondingly, how do I move a table in SQL Server?

In SQL Server Management Studio you have Import and Export Wizard :

  1. Right click on db name( DB_2 )
  2. Tasks.
  3. Import Data.
  4. Choose data source ( DB_1 )
  5. Choose destination ( DB_2 )
  6. Choose copy data from one ore more tables.
  7. Choose your table ( T1 )
  8. Finish.

How do I create a log file in SQL Server?

In Object Explorer, connect to an instance of the SQL Server Database Engine and then expand that instance. Expand Databases, right-click the database from which to add the files, and then click Properties. In the Database Properties dialog box, select the Files page. To add a data or transaction log file, click Add.

38 Related Question Answers Found

How do I edit a .DB file?

What is file growth in SQL Server?

How do I delete a filegroup in SQL Server?


What are SQL Server files?

How do I add Filestream to an existing database?

How delete data file in SQL Server?


What is primary filegroup SQL Server?

How is Azure SQL database auditing configured?

How do I move a table from one database to another in SQL Server?


How can I duplicate a table in SQL?

How copy data from one table to another in SQL Server?

What is schema in SQL?


How do you backup a table in SQL?

How do you update data from one table to another?