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.
Author |
Topic |
tajdar
Starting Member
3 Posts |
Posted - 2007-04-30 : 08:21:43
|
I 've two database db1 and db2. i've made filegroups of db1 using database partitioning now i want to attach those filegroups to db2. i've made the backup of file groups to overcome the error 'the filegroup is in use'. But now while attaching with sp_attach_single_file_db stored procedure from the given path where the backup of db1 filegroups are present im geting error on db2 the 'db2 is already exist'. i m unable to fine any fruitful result after spending days of days in search. Any one plz tell me how to deal with it. im runing out of time so urgent replies is highly appreciated |
|
readysetstop
Posting Yak Master
123 Posts |
Posted - 2007-04-30 : 08:49:50
|
What are you trying to accomplish by doing this? What's the goal, here?____________________________________________________________________________________"Believe in those who are seeking the truth. Doubt those who say they have found it." -Andre Gide |
 |
|
tajdar
Starting Member
3 Posts |
Posted - 2007-04-30 : 09:10:36
|
i just want to implement databse partitioning feature. where my task is to transfer the data in file groups from db1 to db2. |
 |
|
readysetstop
Posting Yak Master
123 Posts |
Posted - 2007-04-30 : 10:10:08
|
That's not what I was asking. Why do you want to implement partitioning? 1. Partitioning has nothing to do with splitting data between databases. It is internal to a single db.2. Therefore, Detach / Attach has absolutely nothing to do with partitioning.3. If you're just trying to transfer data between databases, SELECT INTO should suffice. Partitioning would have nothing to do with that solution. Neither would filegroups, unless you have a requirement to target a specific filegroup on the destination db, in which case, I'd create the destination tables first, then do an INSERT / SELECT. Homework? :-)____________________________________________________________________________________"Believe in those who are seeking the truth. Doubt those who say they have found it." -Andre Gide |
 |
|
tajdar
Starting Member
3 Posts |
Posted - 2007-05-02 : 01:17:46
|
Ok, i got it just leaving out the partitioning, just tell me how to attach filegroups or how to insert the data present in filegroups is it possible or not if yes then how. |
 |
|
readysetstop
Posting Yak Master
123 Posts |
Posted - 2007-05-02 : 07:09:31
|
Check out RESTORE DATABASE dbname WITH FILEGROUP in BOL. You'll find your answers there.____________________________________________________________________________________"Believe in those who are seeking the truth. Doubt those who say they have found it." -Andre Gide |
 |
|
rmiao
Master Smack Fu Yak Hacker
7266 Posts |
Posted - 2007-05-02 : 10:19:13
|
You can't switch filegroup from one db to other, but can move data between dbs. |
 |
|
|
|
|