sql2008生成insert语句

http://stackoverflow.com/questions/1515969/exporting-data-in-sql-server-as-insert-into

In SSMS in the Object Explorer, right click on the database right-click and pick "Tasks" and then "Generate Scripts".

This will allow you to generate scripts for a single or all tables, and one of the options is "Script Data" (in 2008). If you set that to TRUE, the wizard will generate a script with INSERT INTO () statement for your data.

In 2008 R2 its "Types of Data to Script" which can be "Data Only", "Schema and Data" or "Schema Only" - the default).

alt text

Or if that is too complicated for you, you could also check out the "Data Scripter Add-In" for SQL Server Management Studio:

posted @ 2012-07-21 00:53  庚武  Views(397)  Comments(0Edit  收藏  举报