Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bulk Load Files into SQL Azure?

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.

like image 450
Snowy Avatar asked Jun 15 '11 03:06

Snowy


People also ask

Does Azure SQL support bulk insert?

Azure SQL bulk insert from local. Azure SQL does not support reading files from local storage for bulk operations. Therefore, you cannot carry out bulk insert operations from local storage.


2 Answers

BCP is one way to do it.

This post explains it in three easy steps: Bulk insert with Azure SQL

like image 160
Jeffrey Rosselle Avatar answered Oct 24 '22 09:10

Jeffrey Rosselle


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.

like image 39
Herve Roggero Avatar answered Oct 24 '22 09:10

Herve Roggero