I need to get information from a table, but not all columns, I need to create a new table based on the information obtained in the query. The other table is on a different server, so I need the script
Asked
Active
Viewed 130 times
0
-
Make your question clear. its a little bit confusing to understand.. – Vignesh Kumar A Feb 17 '16 at 16:24
-
I need to convert Select results into Insert script – Richard Feb 17 '16 at 16:25
-
http://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspx – Sean Lange Feb 17 '16 at 16:26
-
are the servers on the same network? you can link the servers then do a simple Insert INTO .. Select. If not on same server, you can use SSIS to transfer just certain columns of a table to another server/database. – Jeremy Feb 17 '16 at 16:35
-
check this out [SELECT INTO](http://stackoverflow.com/questions/19459594/select-into-from-one-sql-server-into-another) – jthalliens Feb 17 '16 at 16:38
-
The servers are on different networks – Richard Feb 17 '16 at 16:59
-
@Richard you can use the bcp utility to dump out the contents of a table, and the same utility to reconstruct the table on the other side. https://www.simple-talk.com/sql/database-administration/working-with-the-bcp-command-line-utility/ – Jeremy Feb 17 '16 at 17:21
-
1another option is to you the built in data scripter in SSMS. See the answer with the most upvotes. http://stackoverflow.com/questions/312576/how-to-simply-generate-the-create-sql-script-for-a-table-and-data – Jeremy Feb 17 '16 at 17:29