2017-04-01 7 views
0

は、私は ここは場合は書く方法!=のIsNullは、SQL StoredProceddure。ここ

Alter procedure Sp_GetEmpById 
(@Id int) 
As 
Begin 
if(@Id!==ISNULL){ 
select Email,Gen,Country from Employee where Emp_Id [email protected] 
} 
Else 
print 'The Id Enter By u is Not Availabe '[email protected] 
End 

私がISNULLで2つのエラーを取得し、Then Id Enter By u is Not in Availabe '[email protected] @Id

+0

@idがnullではないのに、このIDが 'Employee'テーブルに存在しない場合はどうなりますか? –

答えて

0

Helpmeくださいエルス示し小型のStoredProcedureを書きましたこれはコンパイルされますが、あなたの要件についてはわかりません:

create procedure Sp_GetEmpById @Id int 
as 
begin 
if @Id is not NULL 
    select Email,Gen,Country from Employee where Emp_Id = @Id 
else 
    print 'The Id Enter By u is Not Availabe ' + @Id 

end 
関連する問題