将文件批量加载到 SQL Azure 中?
我有一个 ASP.NET 应用程序,它需要上传数兆字节的文件,将它们写入磁盘,然后 MSSQL 2008 使用 BCP 加载它们。
我想将整个内容移至 Azure,但由于 BCP 没有“文件”,任何人都可以评论如何将批量数据从 Azure 应用程序获取到 SQL Azure 吗?
我确实看到了 http://msdn.microsoft.com/ en-us/library/system.data.sqlclient.sqlbulkcopy.aspx 但不确定这是否适用。
谢谢。
I have an ASP.NET app that takes multimegabyte file uploads, writes them to disk, and later MSSQL 2008 loads them with BCP.
I would like to move the whole thing to Azure, but since there are no "files" for BCP, can anyone comment on how to get bulk data from an Azure app into SQL Azure?
I did see http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlbulkcopy.aspx but am not sure if that applies.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
BCP 是实现这一目标的一种方法。
这篇文章通过三个简单的步骤进行了解释:
使用 Azure SQL 批量插入
BCP is one way to do it.
This post explains it in three easy steps:
Bulk insert with Azure SQL
你走在正确的轨道上。批量复制 API 将起作用。我正在使用它。这是导入数据最快的方法,因为它使用 INSERT BULK 语句。不要与 SQL Azure 中不支持的 BULK INSERT 语句混淆。本质上,BCP 和 SqlBulkCopy API 使用相同的方法。
You are on the right track. The Bulk Copy API will work. I am using it. And it's the fastest way to import data because it uses INSERT BULK statements. Not to get confused with the BULK INSERT statement which is not supported in SQL Azure. In essence, BCP and the SqlBulkCopy API use the same method.
http://www.solidq.com/sqj/Pages/2011-May-Issue/Migration-Data-into-Microsofts-Data-Platform-SQL-Azure.aspx 了解详细信息可用选项分析
http://www.solidq.com/sqj/Pages/2011-May-Issue/Migrating-Data-into-Microsofts-Data-Platform-SQL-Azure.aspx for a detailed analysis of options available
我认为值得注意的是,在使用格式文件进行导入时,BCP 无法处理 Unicode 源文件。
I think it's important to note that BCP cannot handle source files that are Unicode while using a format file to do your import.