Groups | Blog | Home
all groups > sql server mseq > july 2003 >

sql server mseq : update problem


Vijay
7/31/2003 12:09:50 AM
I have a strange problem.. The following update query is
not working

update userinfo set userstatus=0 where enddt is not null
and enddt<getdate()

and it gives me the following error:

Subquery returned more than 1 value. This is not permitted
when the subquery follows =, !=, <, <= , >, >= or when the
subquery is used as an expression.


Also i tried out the following queries which also throwed
the same error.

update userinfo set userstatus=0 from userinfo where
userid in (select userid from userinfo where enddt is not
null and enddt<getdate())

update userinfo set userstatus=0 where userid in
(1554,1653,1677)

Please suggest me a suitable query to perform the action.

Eric
7/31/2003 6:30:07 AM

Need more information.
Is userinfo a Table or a View?
What are the datatypes of userstatus and enddt?

Cheers,
Eric

[quoted text, click to view]
vkpalivela
7/31/2003 7:07:43 AM
The query is for the table and the datatype for enddt is
smalldatetime and for userstatus, the datatype is tinyint.
I also tried out changing the enddt datatype to datetime
and even then it failed to execute.


[quoted text, click to view]
AddThis Social Bookmark Button