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 2000 Forums
 SQL Server Development (2000)
 update Table

Author  Topic 

zubairmasoodi
Starting Member

35 Posts

Posted - 2007-02-27 : 07:46:29
Hi all
Suppose i have Two Tables ( A & B) With The following same Table structure
Table A
Emp_id P.K
Emp_Name Varchar
Sal int

Table B
Emp_id P.K
Emp_Name Varchar
Sal int

Both The tables contain the data except the fact That
sal column of Table B currently Contain Null Values

I want an Sql query which will update the sal column of Table B with that
Sal column of Table A.

Thanks in Advance

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-02-27 : 07:49:38
[code]Update B
Set Sal = A.Sal
From B JOIN A
ON B.Emp_id = A.Emp_id
[/code]

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

zubairmasoodi
Starting Member

35 Posts

Posted - 2007-02-27 : 08:05:02
Thanks Harsh
Go to Top of Page
   

- Advertisement -