Possible Duplicate:
Get script of SQL Server data
I want to move some rows from 1 table (on one server) to another (on another server).
The table schema is the same, what I need to do is generate some insert statements. Is there a way to do this using some built in / best practice way?
Import / Export seems completely extreme and excessive.
Thanks in advance.
In SSMS Object Explorer, right-click the database. From the right-click menu, go to Tasks >> Generate Scripts... In the Generate and Publish Scripts pop-up window, press Next to choose objects screen. Now, the choose objects screen, choose Select specific database objects and choose the tables you want to script.
Now right-click the database then Tasks->Generate scripts. After that a window will open. Select the database and always check "script all objects in the selected database". It will generate a script for all the tables, sp, views, functions and anything in that database.
1- Open SQL server Management Studio. 2- Right click on the DB that contains your desired table. 3- Select "Tasks => Generate Scripts...". 4- Follow on the wizard, and choose the objects that you want to generate scripts for (Tables, Views, Stored Procedures, etc... ).
Use SQL Server Management StudioIn Object Explorer, right-click Tables and select New Table. In Object Explorer right-click the table you want to copy and select Design. Select the columns in the existing table and, from the Edit menu, select Copy.
Right-click on the database name and choose Tasks -> Generate Scripts. On the Scripting Options screen set Script Data to true.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With