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 |
|
petercdobbs
Starting Member
3 Posts |
Posted - 2009-09-24 : 09:24:46
|
| I must have done a query like this a million times, today i get an error. Please save me before i smash my computer...UPDATE ProductInventorySET OnHand = 100, ControlType = 1, countsDown = 0WHERE (productInvId IN (SELECT productInventoryId FROM __temp_xx))__temp_xx is just a basic table with one column and a distinct list of integers.productInvId is the primary key for the productInventory TableI get this error:Msg 512, Level 16, State 1, Procedure t_PI_Update_Desc_Flag, Line 33Subquery 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.AGGGGGGGGGGGGGGGGGGGGGGG!!!!!! |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-09-24 : 09:26:41
|
| What happens when you do thisUPDATE ProductInventorySET OnHand = 100, ControlType = 1, countsDown = 0WHERE productInvId IN(SELECT productInventoryIdFROM __temp_xx)MadhivananFailing to plan is Planning to fail |
 |
|
|
petercdobbs
Starting Member
3 Posts |
Posted - 2009-09-24 : 09:36:57
|
| i get this:Msg 512, Level 16, State 1, Procedure t_PI_Update_Desc_Flag, Line 33Subquery 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. |
 |
|
|
mhorseman
Starting Member
44 Posts |
Posted - 2009-09-24 : 10:04:37
|
| I see that the error is on Line 33 of your proc. Are you sure that your update statement is the problem?Mark |
 |
|
|
petercdobbs
Starting Member
3 Posts |
Posted - 2009-09-24 : 10:11:22
|
| it's the trigger.thanks! |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-09-24 : 10:17:10
|
quote: Originally posted by petercdobbs it's the trigger.thanks!
Post the trigger codeMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|
|