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)
 Changing Datafile from a Filgroup to another

Author  Topic 

jhnegrao
Yak Posting Veteran

81 Posts

Posted - 2007-03-15 : 15:27:19
Anybody knows, if change a specific datafile already created and has been used from a Filegroup to another using ALTER DATABASE sintaxe?

Best Regards

Juliano Horta

jhnegrao
Yak Posting Veteran

81 Posts

Posted - 2007-03-16 : 11:01:02
Are there any other way to change it? Is it possible?

Thanks
Go to Top of Page

nosepicker
Constraint Violating Yak Guru

366 Posts

Posted - 2007-03-20 : 20:52:12
If I understand you correctly, you cannot move data from one datafile to another with just the alter database command. What are you trying to ultimately accomplish? Are you trying to move the data to another drive?
Go to Top of Page

jhnegrao
Yak Posting Veteran

81 Posts

Posted - 2007-03-20 : 23:21:16
Hello, I'm sorry!

My english was terrible.
I would like to change a Datafile from primary filegroup to a user created filegroup. Is it possible?

Best Regards

quote:
Originally posted by nosepicker

If I understand you correctly, you cannot move data from one datafile to another with just the alter database command. What are you trying to ultimately accomplish? Are you trying to move the data to another drive?


Go to Top of Page

MohammedU
Posting Yak Master

145 Posts

Posted - 2007-03-21 : 01:17:59
I don't think you can move the files from one filegroup to another but you can move the data to different filegroup and delete the file...

1. Add new file to the non primary filegroup (user filegroup)
2. Move the objects to non primary filegroup (user filegroup)
3. Run the dbcc shrinkfile command with EMPTY option
4. Delete the file from primary file group...


MohammedU
Go to Top of Page

jhnegrao
Yak Posting Veteran

81 Posts

Posted - 2007-03-21 : 09:11:06
Hello,

Thank you very much!
I thought we had another possibility instead of create a new one file in a non default filegroup and that we could just change this file from a filegroup to other one.

I will do that.

Thanks
Go to Top of Page
   

- Advertisement -