Conversion failed when converting the nvarchar value 'YYYY' to data type int.
Hi,When i am execute this procedure then i got output as 'Conversion failed when converting the nvarchar value 'YYYY' to data type int.'
please check this procedure and sugesst me how to occur this error in logon_Setting tables all the column has nvarchar datatype.
ALTER Proc [dbo].[GetUserRights](@UserNAme nvarchar(15),@Type nvarchar(3),@ReturnVal nvarchar(5) output)
as
begin
declare @a nvarchar(1),@b nvarchar(1),@c nvarchar(1),@d nvarchar(1),@result nvarchar(5);
select @a=INSERTYN,@b=UPDATEYN,@c=DELETEYN,@d=AUTHORIZEYN from logon_setting where type=@Type and user_name=@UserNAme
set @result=@a+@b+@c+@d;
set @ReturnVal=@result
return @ReturnVal;
end