SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2012 Forums
 Transact-SQL (2012)
 move data from database to other database
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

samir.first
Starting Member

Egypt
34 Posts

Posted - 10/01/2013 :  16:42:18  Show Profile  Reply with Quote
i need move data from database to other database
DB1
Table1
ID Name
2562 samir
2563 john
DB2
Table1
ID name
1 samir
2 john
and Table1 Relation For other More Tables
I need Query Change ID in Other Tables

DonAtWork
Flowing Fount of Yak Knowledge

2161 Posts

Posted - 10/02/2013 :  08:08:37  Show Profile  Reply with Quote
if the ID is an identity, you could use IDENTITY_INSERT.
Also, try looking at the MERGE statement.

You are not clear with your requirements. Are there any business rules that you need to follow, or just overwrite DB2 table with data in DB1 table?








How to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Go to Top of Page

waterduck
Aged Yak Warrior

Malaysia
964 Posts

Posted - 10/03/2013 :  04:59:21  Show Profile  Reply with Quote
try using SQL Server Import and Export Wizard
Go to Top of Page

kdeutsch
Yak Posting Veteran

USA
83 Posts

Posted - 10/03/2013 :  14:45:00  Show Profile  Reply with Quote
Without knowing more information and if you are just moving data from one table to another.
1. Delete other table
2. then recreate with Select * into (RECREATE TABLE) from Old table
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.09 seconds. Powered By: Snitz Forums 2000