The only way to do this is:
SELECT blah INTO [ #local | ##global ] FROM ... WHERE
But this is not a permanent table and will disappear when ...
if #local table then when the user is disconnected if ## is a global table, then when all users using it disconnect
So not a good solution.
You can write a stored procedure to make create + insert, and then execute it in many places with just one subsequent statement, but this kind of hype with the answer.
source share