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
 General SQL Server Forums
 New to SQL Server Programming
 moving data between tables

Author  Topic 

kvishnuprasad
Starting Member

13 Posts

Posted - 2008-07-05 : 08:24:50
HI
I have two tables named
Table name:People(insId,a,b,c,d columns)
Table name:Move(InId,f,g,h,i columns)
I want to move some data from column "h" to column "a" based on insId.
I tried this it dint work.

""if People.insId=Move.inId then update People set People.a=Move.h""

I tried using the table number instead of table name it to odint work. any ideas????????

Regards,
Vishnu

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-07-05 : 09:34:40
[code]
update p
set a = m.h
from people p
inner join move m on p.insid = m.isnd
[/code]


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

kvishnuprasad
Starting Member

13 Posts

Posted - 2008-07-05 : 11:04:12
Thank you , it works fine
Go to Top of Page
   

- Advertisement -