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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 What is causing this error?

Author  Topic 

JohnJohn73
Yak Posting Veteran

57 Posts

Posted - 2007-10-30 : 13:30:33
OK, here is 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."


Here is the code in my stored procedure.

ALTER PROCEDURE dbo.UpdateOperations

(
@id nvarchar(50),
@name nvarchar(100),
@cost float,
@number int
)

AS
UPDATE Operations
SET
[Name]=@name,
Cost=@cost,
Number=@number
WHERE
ID=@id
RETURN

I don't know what the problem is. In my other stored procedures where I update an item by a unique field, they work fine.

Thanks for any help.

JohnJohn73
Yak Posting Veteran

57 Posts

Posted - 2007-10-30 : 13:38:39
Oh, the ID column is a primary key column.
Go to Top of Page

JohnJohn73
Yak Posting Veteran

57 Posts

Posted - 2007-10-30 : 14:41:07
bump
Go to Top of Page

dataguru1971
Master Smack Fu Yak Hacker

1464 Posts

Posted - 2007-10-30 : 14:45:15
The error is pretty specific to a subquery, which I don't see in your update statement.
Is there more to the procedure?

I also don't think the RETURN statement should be there by itself...there must be more to this procedure we aren't seeing?
Go to Top of Page

JohnJohn73
Yak Posting Veteran

57 Posts

Posted - 2007-10-30 : 14:49:30
Thanks for jogging my memory dataguru. There's a trigger on this table. So i need to deal with that. That's where error is coming from.
Go to Top of Page

JohnJohn73
Yak Posting Veteran

57 Posts

Posted - 2007-10-30 : 14:53:22
Yep, that's exactly what it was--the trigger.

Thanks for the subtle help!
Go to Top of Page
   

- Advertisement -