March 12, 2012 at 5:30 am
Hi ,
Say i have db1 and db2 .
I want the tables uder db1 to be availaible in db2. Import/Export is one option. Can restore db also be used in this case ? Or can db restores be used only with overwrite . I tried without overwrite and it gives me an error. When i check the iwth overwrite option , it executes successfully , but then again the purpose is lost.
Thanks in advance.
March 12, 2012 at 5:34 am
No, restoring a database over an existing one will always replace it entirely. You can't merge two databases with restore.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
March 12, 2012 at 5:36 am
sufiyan.sarguroh (3/12/2012)
Say i have db1 and db2 .I want the tables uder db1 to be availaible in db2. Import/Export is one option. Can restore db also be used in this case ? Or can db restores be used only with overwrite . I tried without overwrite and it gives me an error. When i check the iwth overwrite option , it executes successfully , but then again the purpose is lost.
Restore operation is going to destroy the existing target database and replace it with the one in the dump file you are restoring.
If what you need is to "make available" some tables of database 1 in database 2, you can just point to those tables; if in the same SQL Server just name the right database, if in different servers "remote server" might be your option.
If what you need is to make a copy of some tables of database 1 in database 2 then depending on business needs you have a wide range of option ranging from export/import to replication.
_____________________________________
Pablo (Paul) Berzukov
Author of Understanding Database Administration available at Amazon and other bookstores.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.March 12, 2012 at 5:54 am
Thanks ,
Import/Export it is then 🙂
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply