SQL 自动生成带有虚拟数据的sql插入语句

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3570018/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-01 07:19:44  来源:igfitidea点击:

Automatically generate sql insert statement with dummy data

sqldatabaseinsertdummy-data

提问by Omri

Possible Duplicate:
Quickest way to fill SQL Table with Dummy Data

可能的重复:
用虚拟数据填充 SQL 表的最快方法

I'm looking for a tool that will generate insert statement for an existing database filled with dummy data.
This is meant to allow testing of the system.

我正在寻找一种工具,该工具将为填充有虚拟数据的现有数据库生成插入语句。
这是为了允许对系统进行测试。

I'm thinking about something that reads the type of each field and generates data accordingly. If the field name is "username" for example, it's best if it actually knows to take common user names. It should obviously also keep database relations with foreign key constraints.

我正在考虑读取每个字段的类型并相应地生成数据的东西。例如,如果字段名称是“用户名”,那么它最好知道采用常见的用户名。显然,它还应该保持与外键约束的数据库关系。

This doesn't seem too difficult to write this. Is there anything ready which I can use?

写这个似乎并不难。有什么可以使用的吗?

Thanks, Omri

谢谢,暗里

回答by pleasedontbelong

i use this one http://www.generatedata.com/and its free :)

我使用这个 http://www.generatedata.com/和它的免费 :)

回答by Matt Phillips

Checkout http://www.generatedata.com/its a gpl tool to do stuff like that. Most people write scripts that do it because its really hard to account for all the constraints and setup of database tables.

结帐http://www.generatedata.com/它是一个 gpl 工具来做这样的事情。大多数人编写脚本来执行此操作,因为很难考虑数据库表的所有约束和设置。

回答by AdaTheDev

Check out Red Gate's SQL Data Generator- not free, but is ready to do what you want.

查看 Red Gate 的SQL 数据生成器- 不是免费的,但已准备好执行您想要的操作。

回答by Kashif

This looks like very unique requirement of data generation but this answer might help.

这看起来是数据生成的非常独特的要求,但这个答案可能会有所帮助。

quickest-way-to-fill-sql-table-with-dummy-data

填充 sql-table-with-dummy-data 的最快方法