是否有任何免费工具可以在 MS SQL Server 中生成“INSERT INTO"脚本? [英] Are there any free tools to generate 'INSERT INTO' scripts in MS SQL Server?

查看:25
本文介绍了是否有任何免费工具可以在 MS SQL Server 中生成“INSERT INTO"脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用 SQL Server 时,我唯一没有的自动化工具是可以创建 INSERT INTO 脚本的程序.我并不迫切需要它,所以我不会花钱.我只是想知道是否有任何东西可以用于在给定现有数据库的情况下生成 INSERT INTO 脚本而无需花费大量资金.

我在 SQL Server Management Studio Express 中搜索过,但没有找到这样的功能.如果它存在于 SSMSE 中,那么我从未找到它.

解决方案

这个网站有很多有用的脚本,包括 生成插入.

您可以使用 sp_msforeachtable 和它来为整个数据库生成.

更新:在 SQL Server Management Studio 2008(以后)中有将数据脚本化为 INSERT 的内置功能.<​​/p>

SQL Server 2008:

在 SSMS 中右键单击您的数据库,选择 Tasks –>生成脚本,确保您的数据库突出显示,然后单击下一步.将选项列表向下滚动到表/视图选项"部分,并将脚本数据"更改为 True.

SQL Server 2012:

在 SSMS 中右键单击您的数据库,选择 Tasks –>生成脚本.选择要为其生成脚本化插入的表,然后单击 Next.选择要将输出发送到的位置(例如新的查询窗口),然后单击 Advanced 按钮(出于某种原因,该按钮位于保存到文件"部分!).将选项列表向下滚动到要编写脚本的数据类型"选项,并将其更改为仅数据"或架构和数据".单击 Next 两次.

The only thing I don't have an automated tool for when working with SQL Server is a program that can create INSERT INTO scripts. I don't desperately need it so I'm not going to spend money on it. I'm just wondering if there is anything out there that can be used to generate INSERT INTO scripts given an existing database without spending lots of money.

I've searched through SQL Server Management Studio Express with no luck in finding such a feature. If it exists in SSMSE then I've never found it.

解决方案

This web site has many useful scripts including generating inserts.

You can utilise sp_msforeachtable with it to generate for an entire DB.

Update: There is built-in functionality to script data as INSERTs in SQL Server Management Studio 2008(onwards).

SQL Server 2008:

Right-click on your database in SSMS, select Tasks –> Generate Scripts, ensure your database is highlighted and click next. Scroll down the options list to the "Table/View Options" section, and change "Script Data" to True.

SQL Server 2012:

Right-click on your database in SSMS, select Tasks –> Generate Scripts. Choose the tables you want to generate scripted INSERTs for, then click Next. Choose where you want to send the output to (such as a new Query Window), and then click the Advanced button (which for some reason is in the Save to File Section!). Scroll down the options list to the "Types of data to script" option and change it to either "Data only" or "Schema and data". Click Next twice.

这篇关于是否有任何免费工具可以在 MS SQL Server 中生成“INSERT INTO"脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆