Quantcast
Channel: Answers for "Get results into table from dynamic tsql"
Viewing all articles
Browse latest Browse all 4

Answer by Magnus Ahlkvist

$
0
0
When you say "dynamic query results", I assume you mean the results from a string containing sql, that you execute with EXECUTE('select * from someTable') If that's the case, you have only one option that I can think of: Use a global temporary table. Like this: EXECUTE('SELECT * INTO ##t FROM someTable') Then you can use the global temporary table in your code. Like this: SELECT * FROM ##t The problem with this solution is that the temporary table you create is global. It will cause problems in a multi-user environment, if this is run by two users at the (more or less) same time the SELECT INTO will fail since the table already exists.

Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles





Latest Images