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
 General SQL Server Forums
 Script Library
 Update-statement

Author  Topic 

karrisql.com
Starting Member

3 Posts

Posted - 2007-01-26 : 05:57:50
Hi,

I need help for this:
UPDATE T_TABLE
SET DATE1 = TABLE2.DATE2
FROM T_TABLE TABLE inner join T_TABLE2 TABLE2
ON TABLE.col1 = TABLE2.col1
and TABLE.col2 = TBLE2.col2
where TABLE.col3 IS NULL

When I parse the query => Ok, but when I try to run it
I got next error message:

Error Source: Microsoft OLE DB Provider for SQL Server

Error Description: The statemnen has been teminated
Subquery returned more than 1 value. this is not permitted
when the subquery follows =, !=, <, <=, >, >=
or when the subquery is used as an expression.

I'm using this in local package in SQL Server2000,
What is wrong and how can I fix it?

BR Karri

nr
SQLTeam MVY

12543 Posts

Posted - 2007-01-26 : 06:01:50
Are you sure that's what's causing the error?
What happens if you run it in query analyser?

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

karrisql.com
Starting Member

3 Posts

Posted - 2007-01-26 : 06:16:45
quote:
Originally posted by karrisql.com

Hi,

I need help for this:
UPDATE T_TABLE
SET DATE1 = TABLE2.DATE2
FROM T_TABLE TABLE inner join T_TABLE2 TABLE2
ON TABLE.col1 = TABLE2.col1
and TABLE.col2 = TBLE2.col2
where TABLE.col3 IS NULL

When I parse the query => Ok, but when I try to run it
I got next error message:

Error Source: Microsoft OLE DB Provider for SQL Server

Error Description: The statemnen has been teminated
Subquery returned more than 1 value. this is not permitted
when the subquery follows =, !=, <, <=, >, >=
or when the subquery is used as an expression.

I'm using this in local package in SQL Server2000,
What is wrong and how can I fix it?

Query analyzer gives this:

Subquery 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.

BR Karri

Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2007-01-26 : 07:15:34
ok you should have got an invalid use of identifier TABLE and TBLE2 not found.

I'm guessing that's not the actual statement you are running and I don't think this could give the error you are getting.

Are either of these views? Otherwise are you using a derived table?


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -