Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Error: Only one expression can be specified in the select list

Posted on 2005-04-20
2
Medium Priority
?
240 Views
Last Modified: 2008-03-06
Hi,

Please kindly assis in this error message:
Server: Msg 116, Level 16, State 1, Procedure score_add_verify, Line 6
Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.

create procedure dbo.score_add_verify
@callnumber as int,
@datemonitored as datetime,
@operatorid as int
as
if(select * from operator_analysis
where (callnumber=@callnumber and datemonitored=@datemonitored and operatorid=@operatorid))>0
return 1
else
return 0
Go

0
Comment
Question by:EdwardPeter
2 Comments
 
LVL 14

Assisted Solution

by:Renante Entera
Renante Entera earned 1000 total points
ID: 13823082
Hi EdwardPeter!

Try this :

@callnumber as int,
@datemonitored as datetime,
@operatorid as int
as
if EXISTS(select * from operator_analysis
where callnumber=@callnumber and datemonitored=@datemonitored and operatorid=@operatorid)
return 1
else
return 0
Go

Hope this helps you.  Just try it.


Goodluck!
eNTRANCE2002 :-)
0
 
LVL 43

Accepted Solution

by:
TimCottee earned 1000 total points
ID: 13823147
Hi EdwardPeter,

Or

if(select Count(*) from operator_analysis
where (callnumber=@callnumber and datemonitored=@datemonitored and operatorid=@operatorid))>0


Tim Cottee
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how the fundamental information of how to create a table.
Suggested Courses

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question