diff --git a/samples/features/sql-bulk-load/load-from-azure-blob-storage/LoadFromAzureBlobStorage.sql b/samples/features/sql-bulk-load/load-from-azure-blob-storage/LoadFromAzureBlobStorage.sql index 979743770a..93235dc321 100644 --- a/samples/features/sql-bulk-load/load-from-azure-blob-storage/LoadFromAzureBlobStorage.sql +++ b/samples/features/sql-bulk-load/load-from-azure-blob-storage/LoadFromAzureBlobStorage.sql @@ -1,4 +1,5 @@ -/******************************************************************************** + +--/******************************************************************************** * Note: You can export file and create format file using bcp out command: * *>bcp "SELECT Name, Color, Price, Size, Quantity, Data, Tags FROM Product" queryout product.dat -d ProductCatalog -T @@ -46,7 +47,8 @@ WITH ( TYPE = BLOB_STORAGE, DROP TABLE IF EXISTS Product; GO - +--Create a permanent table. A temp table currently is not supported for BULK INSERT, although it will will work +--with OPENROWSET CREATE TABLE dbo.Product( Name nvarchar(50) NOT NULL, Color nvarchar(15) NULL, @@ -54,8 +56,8 @@ CREATE TABLE dbo.Product( Size nvarchar(5) NULL, Quantity int NULL, Data nvarchar(4000) NULL, - Tags nvarchar(4000) NULL, - INDEX cci CLUSTERED COLUMNSTORE + Tags nvarchar(4000) NULL + --,INDEX cci CLUSTERED COLUMNSTORE ) GO @@ -69,6 +71,7 @@ FROM 'product.csv' WITH ( DATA_SOURCE = 'MyAzureBlobStorage', FORMAT='CSV', CODEPAGE = 65001, --UTF-8 encoding FIRSTROW=2, + ROWTERMINATOR = '0x0a', TABLOCK); -- 2.2. INSERT file exported using bcp.exe into Product table @@ -93,4 +96,4 @@ FROM OPENROWSET(BULK 'product.bcp', DATA_SOURCE = 'MyAzureBlobStorage', FORMATFILE='data/product.fmt', FORMATFILE_DATA_SOURCE = 'MyAzureBlobStorage') as data -GROUP BY Color; \ No newline at end of file +GROUP BY Color;