Use a string in another string - mssql - table panel

Hello,

I work on a table panel, with a mssql base.
I want to integrate this code (from another soft - SQL server management studio) :

DECLARE @SQLString nvarchar(max)

SET @SQLString = “SELECT TagName, DateTime, Value
> FROM runtime.dbo.History
> WHERE TagName IN (‘MetalDetector_01.Ejection’, ‘MetalDetector_01.Emptying_Action’)
> AND wwRetrievalMode = ‘Full’
> AND wwVersion = ‘Latest’
> AND DateTime >= ‘2019-09-20 04:27:24.788’
> AND DateTime <= '2019-09-20 11:48:03.541’”

INSERT INTO @Result EXEC(‘SELECT * FROM OPENQUERY(INSQL,"’ + @SQLString + ‘")’)

My problem, in grafana, this “text” is not seen as a string, but this ‘text’ is… I don’t know how to make something like this works :

@myStr = ‘xxx(“yyy”, “zzz”)’ (simple and double quote)

I also tried to use :

@myStr = ‘xxx(’‘yyy’‘, ‘‘zzz’’)’ (only simple quotes but used twice inside the main simple quote)

@myStr = ‘’‘xxx(‘yyy’, ‘zzz’)’‘’ (three simple quotes then one simple)

but it doesn’t seems to be right too… Am I missing something here ?

Thanks in advance.