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
 General SQL Server Forums
 New to SQL Server Programming
 Copying from one column to another?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

fazsnatch
Starting Member

4 Posts

Posted - 06/18/2012 :  05:37:38  Show Profile  Reply with Quote
Hello,

I am trying to copy data from column in a table to another column in a table. The second table already contains some data but the data i get from the first column should hopefully overwrite it.

I am still learning being a newbie :D and wondering what code can be used to simply copy data from the table and then add it into this table.

Thank you

nigelrivett
Flowing Fount of Yak Knowledge

United Kingdom
3328 Posts

Posted - 06/18/2012 :  05:42:06  Show Profile  Visit nigelrivett's Homepage  Reply with Quote
Are they in the same table?
If not what is the join condition?

update tale2
set col1 = t2.col2
from table2 t2
join table1 t1
on t1.colpk = t2.colpk

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.

Edited by - nigelrivett on 06/18/2012 05:43:00
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.38 seconds. Powered By: Snitz Forums 2000