码迷,mamicode.com
首页 > 数据库 > 详细

怎么从sqlserver 数据库导出 insert 的数据语句

时间:2015-08-19 14:50:00      阅读:179      评论:0      收藏:0      [点我收藏+]

标签:

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". If you set that to TRUE, the wizard will generate a script with INSERT INTO () statement for your data.

nb if using 2008 R2 or 2012 its called something else, see screenshot below this one

技术分享

2008 R2 or later eg 2012

elect "Types of Data to Script" which can be "Data Only", "Schema and Data" or "Schema Only" - the default).

技术分享

And then there‘s a "SSMS Addin" Package on Codeplex (including source) which promises pretty much the same functionality and a few more (like quick find etc.)

 

 

For the sake of over-explicit brainlessness, after following marc_s‘ instructions to here...

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

... I then see a wizard screen with "Introduction, Choose Objects, Set Scripting Options, Summary, and Save or Publish Scripts" with prev, next, finish, cancel buttons at the bottom.

On the Set Scripting Options step, you have to click "Advanced" to get the page with the options. Then, as Ghlouw has mentioned, you now select "Types of data to script" and profit.

技术分享

怎么从sqlserver 数据库导出 insert 的数据语句

标签:

原文地址:http://www.cnblogs.com/haoliansheng/p/4742170.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!