Reputation: 53
I have a sql query wherein the output(rows) of my query are gathered in a table variable named "@Data" and the number of rows generated as output are around 50000. How can I copy those rows in to a table which is present in my SQL database? I am using MS SQL.
Thanks in advance.
Upvotes: 0
Views: 436
Reputation: 117350
insert into <your table name> (
<columns>
)
select
<columns>
from @Data
As a side note, using table variables with number of rows ~50K usually do not gives you good performance, you can consider temporary tables instead
Upvotes: 1