Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Files group

Author  Topic 

acko
Yak Posting Veteran

52 Posts

Posted - 2004-02-17 : 09:50:50
Hi
How i know size of the table and on which file group is table created? Is there a way to remove table from one to other file group. At this time my database has one PRIMARY file group, and two data files both on PRIMARY file group. So i would like to create the other file group on differnt disk, and to remove some tables on that file group.
Thanks a lot.
Alex

nr
SQLTeam MVY

12543 Posts

Posted - 2004-02-17 : 10:12:04
Try sp_spaceused and sp_help.
You can move tables by building a clustered index. The leaf level is the data pages so will move the data.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

JohnDeere
Posting Yak Master

191 Posts

Posted - 2004-02-17 : 10:29:18
sp_help <tablename> will give you information about the table including the filegroup.

A filegroup i.e. primary can contain many physical files that exist on different drives. You can create a new filegroup if you like, but you do not have to create a new filegroup to add files to the database.

If you are trying to force the new space to be used then one method would be create a filegroup and create tables on the new file group using the ON keyword. You then migrate the data from the old table to the new table.

Alternative method to move the table is to drop and recreate the clustered index specifying the index be created on the new filegroup. This will move the table to the new filegroup. Your database will not be available during this process.

Another method would be to limit the size of your current data files assuming they do not have a lot of free space and this will force sql server to place data on the new files since they have free space. Using this method should not require as much down time, but you do not have control over what data the server will put on the new storage area.


Lance Harra
Go to Top of Page

acko
Yak Posting Veteran

52 Posts

Posted - 2004-02-18 : 08:30:50
thanks a lot
alex
Go to Top of Page
   

- Advertisement -