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 2008 Forums
 Transact-SQL (2008)
 Data migration from table 1 to table 2

Author  Topic 

sconard
Starting Member

18 Posts

Posted - 2011-03-23 : 16:07:26
I have yet to find an example of best practice to migrate data from one table to another.

Table1
field1
field2
field3

Is to be migrated to

Table2
field4
field5
field6

so all records from Table1 will be appended to Table2 in available fields(that have dif names)

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-03-23 : 16:21:23
You would just use INSERT INTO/SELECT for this.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

sconard
Starting Member

18 Posts

Posted - 2011-03-24 : 07:54:19
Hmm. It is the syntax that I need. I have yet to be able to find and example.
Go to Top of Page

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2011-03-24 : 08:49:38
Fire up SSMS. Push F1. This will give you a few good examples of how to use the INSERT INTO/SELECT syntax.
Books Online will lead you to this link: [url]http://msdn.microsoft.com/en-us/library/dd776381.aspx[/url]


http://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspx
How to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

For ultra basic questions, follow these links.
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page

sconard
Starting Member

18 Posts

Posted - 2011-03-25 : 15:12:11
best examples found http://support.microsoft.com/kb/111401
Go to Top of Page
   

- Advertisement -