I have dynamic table so I need to execute this query
DECLARE @SQL nvarchar(max)
SET @SQL = 'select x, y from exTable where z like 'example' '
EXEC (@SQL)
I have problem becouse ‘example’ can’t be added to @sql variable.
I try to add &apos ;example&apos ; but it does not work.
Any suggestion how can I change from &apos ; –> ‘
You can quote quotes in SQL by an extra quote: