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.
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.