Fixes in Azure Blob Storage load

Corrected cheka of the target table, skipped first row in CSV examplem
and added BULK INSERT from bcp file.
This commit is contained in:
Jovan Popovic
2017-02-23 11:45:17 +01:00
parent 758dc16b34
commit 2c4eb51d43
@@ -33,8 +33,8 @@ GO
CREATE TABLE dbo.Product(
Name nvarchar(50) NOT NULL,
Color nvarchar(15) NULL,
Size nvarchar(5) NULL,
Price money NOT NULL,
Size nvarchar(5) NULL,
Quantity int NULL,
Data nvarchar(4000) NULL,
Tags nvarchar(4000) NULL,
@@ -51,6 +51,15 @@ BULK INSERT Product
FROM 'data/product.csv'
WITH ( DATA_SOURCE = 'MyAzureBlobStorage',
FORMAT='CSV', CODEPAGE = 65001, --UTF-8 encoding
FIRSTROW=2,
TABLOCK);
-- INSERT file exported using bcp.exe into Product table
BULK INSERT Product
FROM 'data/product.bcp'
WITH ( DATA_SOURCE = 'MyAzureBlobStorage',
FORMATFILE='data/product.fmt',
FORMATFILE_DATA_SOURCE = 'MyAzureBlobStorage',
TABLOCK);
-- Read rows from product.dat file using format file and insert it into Product table