Reputation: 2865
I have access to a View called (vw_table) on Server1. I want to get the data from this view (few million records) into a table on server2.
I tried
SELECT * INTO ##TempTable
FROM VW_Table
This gets the data in to ##TempTable.
Now how can I move it to a different server (server2) and to a different database?
I want Table2 in Server2 to have the data from VW_table.
I appreciate your help.
Upvotes: 0
Views: 62
Reputation: 36156
you cant direct access another server like this. You have to options to solve your problem:
select * from mylinkedserver..table
Upvotes: 1
Reputation: 5626
Like Lemak said, you can't pass temporary tables around like this. You either need to have a Linked Server and copy the data directly into the table, or you need to export the data and import it into the table using SSIS.
Upvotes: 0