August 27, 2008 at 2:55 am
Employee table
EmployeeID Employeename Employeecode Passportcode
1 aaaa 087878
2 bbbb 067678
Passport table
EmployeeId passport code
1 02344
2 02343
How can i update this passport code in the employee table
using update statement any body plz help me.
August 27, 2008 at 3:05 am
Hi there,
Which version of SQL are you using as I see you have posted this on 2000 and 2005 forums
Please could you remove one of them?
Thanks
Chris
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
August 27, 2008 at 3:06 am
Update employee set Passportcode = Passport.Passportcode
From PassPort WHERE Employee.employeeId = PassPort .PassportId.
I suggest you look into BOL and try it out yourself. then if you have doubts ask here. ๐
"Keep Trying"
August 27, 2008 at 3:23 am
here we are using two table so we can use join right
August 27, 2008 at 3:33 am
kumar99ms (8/27/2008)
here we are using two table so we can use join right
Yes.
I suggest you look into BOL and try it out yourself. then if you have doubts ask here.
CONCUR...
karthik
August 27, 2008 at 3:43 am
kumar99ms (8/27/2008)
Employee tableEmployeeID Employeename Employeecode Passportcode
1 aaaa 087878
2 bbbb 067678
Passport table
EmployeeId passport code
1 02344
2 02343
How can i update this passport code in the employee table
using update statement any body plz help me.
UPDATE e SET Passportcode = p.Passportcode
FROM Employee e
INNER JOIN Passport p ON p.EmployeeId = e.EmployeeId
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 27, 2008 at 4:34 am
i am using the above query any performance issue come in future
August 27, 2008 at 5:05 am
How much data is there in your tables and how much more data will be there in the tables in the future.
"Keep Trying"
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply