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
 Old Forums
 CLOSED - General SQL Server
 ERROR (Msg 512, Level 16) IN QUERY

Author  Topic 

chiragvm
Yak Posting Veteran

65 Posts

Posted - 2006-06-09 : 02:14:49
SELECT PARAMETER.CurrentUse, PARAMETER_1.CurrentUse AS Expr1, PARAMETER_2.CurrentUse AS Expr2
FROM PARAMETER INNER JOIN
PARAMETER PARAMETER_1 ON PARAMETER.ServerName = PARAMETER_1.ServerName AND PARAMETER.Device_id = PARAMETER_1.Device_id AND
PARAMETER.AGENT_ID = PARAMETER_1.AGENT_ID INNER JOIN
PARAMETER PARAMETER_2 ON PARAMETER.ServerName = PARAMETER_2.ServerName AND PARAMETER.Device_id = PARAMETER_2.Device_id AND
PARAMETER.AGENT_ID = PARAMETER_2.AGENT_ID
WHERE (PARAMETER.ServerName = 'SUN') AND (PARAMETER.AGENT_ID = '007365-1878') AND (PARAMETER.CurrentUse =
(SELECT currentuse
FROM parameter
WHERE parameter.TimeStamps = CONVERT(DATETIME, '2006-05-01 18:29:36', 102))) AND (PARAMETER_1.CurrentUse =
(SELECT currentuse
FROM parameter
WHERE parameter.TimeStamps = CONVERT(DATETIME, '2006-05-01 18:34:51', 102))) AND (PARAMETER_2.CurrentUse =
(SELECT currentuse
FROM parameter
WHERE parameter.TimeStamps = CONVERT(DATETIME, '2006-05-01 18:40:04', 102)))


WHEN I RUN THIS QUERY ERROR IS
Server: Msg 512, Level 16, State 1, Line 1
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2006-06-09 : 02:37:28
execute the subqueries you used in the where clause,
like what the error message is saying, you cannot equate
xvalue=recordset value, should be 1 is to 1... make sure that the subqueries return only 1 values otherwise, you may want to use IN insted of =

--------------------
keeping it simple...
Go to Top of Page
   

- Advertisement -