473,383 Members | 1,733 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

How do ITables moved to a new FileGroup ?

I have a SQL Server 2000 database and want to now split up the tables
onto seperate file groups as well as some indices.

How do you breakup an existing table to move it from one filegroup
(Primary) to the new filegroup ?

Thanks.

Craig

Jul 23 '05 #1
4 1740
Create (or recreate) a clustered index on the table, and specify that
it should be created on the new filegroup. Since a clustered index
contains the table data at its leaf level, moving the clustered index
moves the table.

Simon

Jul 23 '05 #2
Thanks !

Jul 23 '05 #3
A word of warning, although creating or rebuilding a clustered index,
moves a table to a new filegroup it does not necessarily move all
database objects. I moved a lot of tables from one filegroup to
another. I was a bit surprised sometime latter when one of my
colleagues told me there were a lot of tables on the wrong filegroup.

On investigation I found the script he ran did not differentiate
between tables or other objects. There were no tables there but there
were things like non-clustered non-unique indexes, primary keys etc.

You can use this script to check what objects are where.

select g.name,object_name(i.id),i.indid,i.groupid from sysindexes i
join sysfiles g on i.groupid = g.groupid
order by g.name,object_name(i.id),i.indid

Hope this helps

John
csomb...@dwr.com wrote:
Thanks !


Jul 23 '05 #4
A word of warning, although creating or rebuilding a clustered index,
moves a table to a new filegroup it does not necessarily move all
database objects. I moved a lot of tables from one filegroup to
another. I was a bit surprised sometime latter when one of my
colleagues told me there were a lot of tables on the wrong filegroup.

On investigation I found the script he ran did not differentiate
between tables or other objects. There were no tables there but there
were things like non-clustered non-unique indexes, primary keys etc.

You can use this script to check what objects are where.

select g.name,object_name(i.id),i.indid,i.groupid from sysindexes i
join sysfiles g on i.groupid = g.groupid
order by g.name,object_name(i.id),i.indid

Hope this helps

John
csomb...@dwr.com wrote:
Thanks !


Jul 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: el emperador | last post by:
I have a big table (heap)... well, not so big, I have a small server and I want to spread access to it across several new disks dedicated only to that table. I known its possible to do that...
0
by: Louis | last post by:
I've been experimenting with filegroup backups. I currently "archive" old data by moving it into a different database. I thought I could try to use filegroups instead. That is "archive" old data...
0
by: Louis | last post by:
Please ignore earlier post. I've been experimenting with filegroup backups. I currently "archive" old data by moving it into a different database. I thought I could try to use filegroups...
14
by: LineVoltageHalogen | last post by:
Greetings All, I was hoping that someone might be able to shed some light on this issue. I am trying to add a FileGroup/Datafile to an existing SQL database. The code below compile and it runs in...
2
by: mchang | last post by:
Hello, I have been trying to figure out how to temporarily change the max filegroup size of a SQL 2000 database I "inherited" when our DBA quit. I just need some breathing room until I can...
2
by: si.downes | last post by:
Using SQL Server 2000 SP3 I'm developing a data warehouse where data will be archived off to a filegroup, this filegroup backed up and the tables in this filegroup truncated to free up space on...
4
by: Dr Warehouse | last post by:
Hi, I am expanding our data warehouse solution with new filegroups on several subsystems. I want to know which idea is better! - create clustered indexes on tables to 'move' them to new...
0
by: Takpol | last post by:
Hello, I have several archived filegroups that have data in them partitioned based on the date. These filegroups have been removed from database after archival. For example two months ago....
1
by: jkv10_2005 | last post by:
Hi, I have the following SQL procedure I am running to clean up a filegroup and move all data to a single .MDF file: use <db_name> print 'Move <db_name> db contents to MDF file' DBCC...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.