I want to build a dynamic query like this one:
SELECT CAST(STRING_AGG(Co1,', ') AS STRING) AS Co1
declare string ColName = (select Co1 from #Temp1);
Afterwards I want to be able to select ColNames defined above. In SQL, one can use "exec sp_executesql". However, in data virtuality seems not to work. Any ideas?
I tried couple of things, including following this one: https://datavirtuality.com/docs/content/2.1/Reference%20Guide/Dynamic_SQL_Command.html
Thank you in advance.
Please sign in to leave a comment.