I have a set statement. I am trying to add a where statement inside that. However, when I put a single quote, it is not executing. How to escape the single quote in where clause to execute the set statement? Below is my code:
DECLARE @desttablename NVARCHAR(MAX)
SET @desttablename = 'select distinct desttablename
from #table_norm
where desttablename = 'Screener''