Dynamic Query: Implementation "exec sp_executesql"

Comments

2 comments

  • Comment actions Permalink
    Official comment
    Avatar
    Nick Golovin

    Let me add an example solution here from Zendesk for public reference:

     

    begin
        create local temporary table #Temp1 (col1 string);
        declare string ex_string= 'SELECT CAST(STRING_AGG(col1,'', '') AS STRING) AS col1 into #Temp1 FROM Table1';
        execute immediate ex_string without return;
        select col1 from #Temp1;
    end;;
  • 0
    Comment actions Permalink
    Avatar
    Sebastian Klinnert

    Hi Leo,

    I created this thicket on you behalf, https://datavirtuality.zendesk.com/agent/tickets/20145712.

    We can further discuss in this ticket.

    best
    Sebastian

Please sign in to leave a comment.

Powered by Zendesk