Dear all,
I know this question has been asked many times, but I still got the error after tried their solution.
I have MS sql Db table named [Testing] contains four rows and column
[my_Index] [my_Name] [my_Number] [my_Value]
1 angus 2345 temp1
2 angus 2345 temp2
3 kevin 2345 temp3
4 nancy 2345 temp4
Then I run a sql in asp,
"UPDATE [Testing] SET [my_Number]=1 WHERE my_Name='angus'"
In Testing a have trigger to fed the values to other table
All work fine if just 1 row is update
if @@rowcount = 1
Begin
Set @Status = '1'
End
else
Begin
Set @Status = (SELECT [my_Index] FROM inserted)
End
and then Insert the value to an aduit table
However, I get the error "Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression"
I have tried using IN keyword to fix it but same error occur
Set @Status = (SELECT [my_Index] FROM inserted WHERE [PR_Index] IN (SELECT [PR_Index] FROM inserted))
Can any expert help !!
Start Free Trial