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 |
jaycee
Starting Member
18 Posts |
Posted - 2012-12-04 : 14:58:51
|
I am trying to run an update on a table to transfer an id field to an id field in another table where the forename = forename and surname = surname.In MS Access, I would use:UPDATE Mar INNER JOIN mar ON MyEmployees.FirstName = mar.FirstName AND MyEmployees.LastName = mar.LastName SET mar.extraid = Myemployees.employeeidbut in SQL Server 2005 I get errors.Would the correct TSQL be:UPDATE MarSET Mar.employeeid = Myemployees.EmployeeID,FROM MarINNER JOIN Myemployees ON Mar.Firstname = Myemployees.FirstNameAND Mar.Surname = Mar.SurnameThanks for any help. |
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2012-12-04 : 15:15:03
|
Yes it would work. |
|
|
|
|
|