Hi,
I have not been able to get this to work... In English lingo, I'm wanting to update the AssetPK (int) field in the Error table with the value of PK coming from the Asset table also an integer. Both tables contains a character field named "AssetKey" with the same values that can be used to pair up with. The AssetKey from the Asset table is unique with only a single row containing it )parent), while the Error table can have many, (children).
All of this because I'm changing the parent/child relationship keys from character to integer, which should help in performance, or is it worth the trouble?
Update error
set
Error.AssetPk = (select Pk from Asset where Asset.AssetKey = Error.AssetKey)
Running this returns...
Msg 512, Level 16, State 1, Line 28 - Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
The statement has been terminated.
Thanks for any pointers,
Stanley
I have not been able to get this to work... In English lingo, I'm wanting to update the AssetPK (int) field in the Error table with the value of PK coming from the Asset table also an integer. Both tables contains a character field named "AssetKey" with the same values that can be used to pair up with. The AssetKey from the Asset table is unique with only a single row containing it )parent), while the Error table can have many, (children).
All of this because I'm changing the parent/child relationship keys from character to integer, which should help in performance, or is it worth the trouble?
Update error
set
Error.AssetPk = (select Pk from Asset where Asset.AssetKey = Error.AssetKey)
Running this returns...
Msg 512, Level 16, State 1, Line 28 - Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
The statement has been terminated.
Thanks for any pointers,
Stanley