SQL ' --> ' replacement -


i have dynamic table need execute query

declare @sql nvarchar(max)  set @sql = 'select x, y extable z 'example' '     exec (@sql) 

i have problem becouse 'example' can't added @sql variable.

i try add &apos ;example&apos ; not work.

any suggestion how can change &apos ; --> '

you can quote quotes in sql quote:

set @sql = 'select x, y extable z ''example'' '  

Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

javascript - Preserving URL fragment through CAS sign-on -

asp.net mvc - Implementing normal user/pass, Twitter & Facebook auth -