Skip to content

Commit 2c4eb51

Browse files
committed
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.
1 parent 758dc16 commit 2c4eb51

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

samples/features/sql-bulk-load/load-from-azure-blob-storage/LoadFromAzureBlobStorage.sql

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ GO
3333
CREATE TABLE dbo.Product(
3434
Name nvarchar(50) NOT NULL,
3535
Color nvarchar(15) NULL,
36-
Size nvarchar(5) NULL,
3736
Price money NOT NULL,
37+
Size nvarchar(5) NULL,
3838
Quantity int NULL,
3939
Data nvarchar(4000) NULL,
4040
Tags nvarchar(4000) NULL,
@@ -51,6 +51,15 @@ BULK INSERT Product
5151
FROM 'data/product.csv'
5252
WITH ( DATA_SOURCE = 'MyAzureBlobStorage',
5353
FORMAT='CSV', CODEPAGE = 65001, --UTF-8 encoding
54+
FIRSTROW=2,
55+
TABLOCK);
56+
57+
-- INSERT file exported using bcp.exe into Product table
58+
BULK INSERT Product
59+
FROM 'data/product.bcp'
60+
WITH ( DATA_SOURCE = 'MyAzureBlobStorage',
61+
FORMATFILE='data/product.fmt',
62+
FORMATFILE_DATA_SOURCE = 'MyAzureBlobStorage',
5463
TABLOCK);
5564

5665
-- Read rows from product.dat file using format file and insert it into Product table

0 commit comments

Comments
 (0)