I've written simple stored procedure and executing using sp_executesql to tackle with quotation error and sql injection as well but when i pass a single quote in parameter still it shows me Unclosed quotation mark after the character string ''.
alter procedure dbo.quote_test
(
@quoteid int
)
as
begin
declare @sqlstring as nvarchar(max)
declare @paramdef as nvarchar(100)
set @sqlstring = 'select * from quote where quote_id = @quoteid';
set @paramdef = N'@quoteid int';
exec sp_executesql @sqlstring,@paramdef, @quoteid
end
exec dbo.quote_test 10'