Learn how to a build a cloud-first strategyRegister Now


How do you assign a particular table to a .mdf or .ndf file?

Posted on 2006-04-24
Medium Priority
Last Modified: 2012-06-21
How do you assign the actual storage mechanism of a SQL Server Table (i.e. an .mdf or .ndf) to a particular .mdf?

In other words:
You have 2 tables in a given database but they are on separate OS files (.mdf or .ndf)?
Question by:michaelrobertfrench
  • 2
  • 2
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 16529116
add 2 filegroups to the database, and add 2 data files to the database, each one to a different filegroup.
create the table into the filegroup.
if the table is already created, add a clustered index to the table and drop it afterwards.
if you have already a clustered index, drop it and recreate it to the filegroup

Author Comment

ID: 16529340
OK - how do you "create the table into the filegroup"?

Author Comment

ID: 16529374
I can see from the TSQL syntax of Create Table that there is an option that allows this but how can this be done for the GUI.  

Further, how does the DBA know where the tables or pointing - to which filegroups?
LVL 143

Accepted Solution

Guy Hengel [angelIII / a3] earned 2000 total points
ID: 16529427
>OK - how do you "create the table into the filegroup"?
in the Enterprise Manager, when you create a table / index, you have the "filegroup" combo box with the list of the filegroups (at least containing the PRIMARY filegroup).

>Further, how does the DBA know where the tables or pointing - to which filegroups?
1 table is in EXACTLY 1 filegroup. in the properties it is shown.

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Ready to get certified? Check out some courses that help you prepare for third-party exams.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how the fundamental information of how to create a table.
Suggested Courses

810 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