I have 2 tables, TABLE1 with columns col1, col2, col3, col4 and col5 in a database on server1. I have TABLE2 with the same columns and almost same data as TABLE1 excluding columns col2 and col5 in a database on server2. TABLE2 has the same data in col1, col3 and col4 as TABLE1. Now I know I can just create a new table and use the import/export feature of sql-server. But this would not be feasible if the tables had tons of data and more columns.
So my question is there any way to insert data in col2 and col5 to TABLE2 through any other means? If this is possible I would like to make sure the data that is being inserted is col2 and col5 in TABLE2 matches to that of TABLE1 meaning if I have col1 with data lets say 5 and col2 has data xyz, would like this data to be inserted at this row. (FYI col1 is the primary key on both tables).
Both servers are sql server 2008r2.
col2
andcol5
intotable2
onserver2
and insert all at the same time? Alternatively, if you've imported the data before adding the columns, then you can just join on your PK and update the newly added columns. – RoKa