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

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)?
michaelrobertfrenchAsked:
Who is Participating?
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
>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.
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
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
0
 
michaelrobertfrenchAuthor Commented:
OK - how do you "create the table into the filegroup"?
0
 
michaelrobertfrenchAuthor Commented:
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?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.