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.
| Author |
Topic |
|
ilee1
Starting Member
5 Posts |
Posted - 2007-05-16 : 03:21:14
|
Hi there,Since it's very urgent, can somebody help me on how to copy one column from one table and paste it into another table in the same database SQL server 2005..... Thanks,ilee1 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-05-16 : 03:28:00
|
By "column", do you mean colum data or column definition? If it column data, it's very simple:Update dset col = s.colfrom SourceTbl s join DestTbl d on s.pk = d.pk Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
ilee1
Starting Member
5 Posts |
Posted - 2007-05-16 : 03:55:33
|
Hi Harsh,Thanks for the reply. I already tried your code but failed.pk is primary key?? s.pk is different from d.pk.One is number, one is unique identifier.I just want to overwrite the column with the other. Thanksquote: Originally posted by harsh_athalye By "column", do you mean colum data or column definition? If it column data, it's very simple:Update dset col = s.colfrom SourceTbl s join DestTbl d on s.pk = d.pk Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED"
|
 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-05-16 : 03:59:03
|
| So there is no relation between these two tables? Then how can you overwrite a column in one table with column from another table?Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
ilee1
Starting Member
5 Posts |
Posted - 2007-05-16 : 04:08:16
|
OK, basically this column is the "company name" column which we don't want to repeat typing them again one by one.To be frank this table is imported from MS Access table and now become new table in SQL server. And just want one column of it to be copied over to the existing table in SQL.They have same rows of 250 but pk are different. How....ya....?? |
 |
|
|
ilee1
Starting Member
5 Posts |
Posted - 2007-05-16 : 05:25:05
|
Anybody can help....., please...?It's very frustrating.....Thanks |
 |
|
|
|
|
|