I need to fill a dataset with values from several tables.
I’ve created a stored procedure that executes several SELECT statements.
Each SELECT has common parts.
I decided to cache the results of these common parts.
Now I need the SELECT construct that is capable of outputting the results to a table variable.
INSERT @tableVar SELECT ... only inserts data but does not select it.
My intention is something like SELECT * OUTPUT SELECTED.* INTO @tableVar FROM ...
Is it possible to perform such operation?
1 Answer