While working with SQL you always face columns with NULL values. For avoiding that you can put a check on it. NULL value is something that is different from nothing and space
ALTER proc [dbo].[sp_GetMailToEmployee]
(
@EmployeeID int
)
as
begin
declare @GetMail varchar(200)
declare @status int
set @GetMail=(select EmployeeEmail from EmployeeDetails where EmployeeId=@Employeeid)
if(@GetMail=NULL)
begin
set @status=0
end
else
begin
set @status=1
end
select @GetMail as 'EmployeeEmail',@status as 'Status'
end
0 Comment(s)