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 |
Jaykappy
Starting Member
19 Posts |
Posted - 2011-12-09 : 17:01:38
|
I have Table 2 and Table 1Many to One relationshipI need to update the Multiple rows in Table 2 field "ParentGUID" where Table 1 field "NumofEmpe" and Table 2 Field "CB_ID" are equal...Noting that Table 1 has unique values and Table 2 has multiple...I need teh multiple/duplicate values to populate in Table 2. This will give me the unique values I need to create the relationshipTrying something like this...getting syntax errorsUPDATE Table2 INNER JOIN Table2 ON Table1.NumofEmpe = Table2.CB_ID SET Table2.ParentGuid = [Table1].[ParentGUID]WHERE (((Table2.CB_ID)=[Table1].[NumofEmpe]));Incorrect syntax near Keyword 'INNER'Thoughts?Thanks |
|
vijayisonly
Master Smack Fu Yak Hacker
1836 Posts |
Posted - 2011-12-09 : 17:06:43
|
You're close.UPDATE t2SET t2.ParentGuid = t1.[ParentGUID]FROM Table2 t2 INNER JOIN Table1 t1 ON t1.NumofEmpe = t2.CB_ID |
|
|
Jaykappy
Starting Member
19 Posts |
Posted - 2011-12-12 : 09:30:13
|
Awesome Thanks |
|
|
|
|
|