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
 Update and Insert

Author  Topic 

skc40
Starting Member

34 Posts

Posted - 2011-08-29 : 22:39:39
we use sql 2005

We have an employee table. Email is one of the field which is NUll. Emails is another table that has the employee email information.

I need to update and Insert Employee's Email into Employee Table from Emails table.
How can i achieve it??

Thanks in advance

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2011-08-29 : 22:46:30
[code]
UPDATE e
SET email = a.email
FROM employee e
INNER JONI another_table a ON e.emp_id = a.emp_id
[/code]


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

Go to Top of Page

skc40
Starting Member

34 Posts

Posted - 2011-08-29 : 23:21:09
thanks a lot
Go to Top of Page
   

- Advertisement -