set @TFYID=7
print @TFYID
set @SQL =N'select @ETotal=sum(ExemptionProduce)
from tbl_Income_Exemption
where EmployeeID='''+@EmpID+''' and (TDSSettingsDetailID) in
('+@ConcatString+''') and FinancialYearID='+@TFYID+''
exec sp_executesql @SQL
output :
7
Msg 245, Level 16, State 1, Line 73
Conversion failed when converting the nvarchar value '
select @ETotal=sum(ExemptionProduce)
from tbl_Income_Exemption
where EmployeeID='00402060' and (TDSSettingsDetailID) in
('24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36')
and FinancialYearID=' to data type int.
This Query not showing me properly output. it's give me some error. Please Help me.