chettiar wrote:
the data is as follows
1 a
1 b
1 a
1 c
2 a
2 b
The sql server updates it properly. All I need is a way I can do it in
DB2.
SQL Server may have done this properly in your view but it certainly
isn't guaranteed to do so reliably. More than one value is returned
from the join on the right hand side of the = assignment. The correct
result from the UPDATE is therefore officially undefined in SQL Server.
So if your code works for you today it is probably more by luck than by
design.
This is sloppy and dangerous code. Since it doesn't give any
well-defined result you'd better respecify exactly what result you
expect if you need help to port it.
--
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/m...S,SQL.90).aspx
--