1
Answer

SQL Server Function returns an error.

kiran

kiran

10y
534
1
I created one function to check whether the id exists or not. If it is exists then it returns 1 otherwise it returns 0 but i got an error like this 
 
RETURN statements in scalar valued functions must include an argument. 
 
My function is
 
create function [dbo].[CheckStudentId](@ID varchar(10))
returns varchar
as
begin
return
if exists (select id from Tablename where id=@ID)
print 1
else
print 0
end
 
Thanks in advance 
 

Answers (1)