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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

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

Starting Member

34 Posts

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

Flowing Fount of Yak Knowledge

2167 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:

Go to Top of Page

Aged Yak Warrior

982 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

Yak Posting Veteran

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  
 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.02 seconds. Powered By: Snitz Forums 2000