批量导出和导入sql表行
我需要将包含 24GB 数据的 36 个 SQL 表中的数据导出到平面文件中,将它们复制到客户端并将它们导入到 SQL 数据库中的现有表中。
我需要为几个客户提供这个(尽管是同一张桌子)。
如何批量导出和导入数据?
是否有一个命令行工具可以让我编写一个脚本以供重复使用?
I need to export the data from 36 SQL tables containing 24GB of data into flat files, copy them to the client and import them there into the existing tables in his SQL database.
And I will need this for several customers (same tables, though).
How do I mass export and import data?
Is there a command line tool for this so I can write a script for repeated use?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
此处导入和导出批量数据
什么是 bcp ?
The basic knowledge you will find here Importing and Exporting Bulk Data
What is bcp ?
bcp.exe 是 MSSQL 的标准批量导入/导出工具。使用 SSIS 包是一种替代方案,但会带来大量开销:它是一个完整的 ETL 工具。在 TSQL 中,还有一个 BULK INSERT 语句,您可以使用它来替代“bcp in”,但我个人还没有尝试过看看哪个更快或更有用等。
请参阅“批量导出”和“批量导入”在线图书中了解所有详细信息。
bcp.exe is the standard bulk import/export tool for MSSQL. Using SSIS packages is an alternative, but brings a lot of overhead with it: it's a full ETL tool. In TSQL there's also a BULK INSERT statement that you can use as an alternative to "bcp in", but I personally haven't played around to see which one is faster or more useful etc.
See "bulk exporting" and "bulk importing" in Books Online for all the details.