2014-01-31 127 views
0
ALTER PROCEDURE EditEmployee (

@RefNo integer , 
@EmpId nvarchar , 
@Name ntext , 
@Designation ntext , 
@Qualification ntext , 
@Gender ntext , 
@DOB date , 
@Address text , 
@Email ntext , 
@Phone decimal) 
     as 
     begin 
     UPDATE Emp_Sample 
     SET [email protected],[email protected],[email protected], 
      [email protected],[email protected], 
      [email protected],[email protected],[email protected], 
      [email protected] 
      where [email protected] 

     END 
+0

是EmpId的類型和@EmpId相同嗎? – Miller

+1

你面臨什麼問題? –

+0

@MillerKoijam是的,這是相同的 – Jan

回答

2

您需要包括@EmpId nvarchar大小。

ALTER PROCEDURE EditEmployee (

@RefNo integer , 
@EmpId nvarchar(30) , 

nvarchar [ (n | max) ] 

當在數據定義或變量聲明聲明不指定n,則默認長度爲1.當不與CAST功能指定n,則默認長度爲30

HERE

0

我認爲你有問題Cast

嘗試這樣

WHERE EmpId = CAST(@EmpId AS INT) 
+0

,但EmpId默認已聲明爲nvarchar – Jan

+0

@ user3256231我可以知道它的值嗎? –

+0

EmpId = E92。這是你想要的? – Jan