1
0
mirror of https://github.com/Microsoft/sql-server-samples.git synced 2025-12-08 14:58:54 +00:00
Files
sql-server-samples/samples/demos/belgrade-product-catalog-demo/sql-scripts/8. bcp.sql
Jovan Popovic 61c69c1c3c Added new samples
BCP, string_agg sample, and comparisng with EF.
2017-03-05 20:38:57 +01:00

37 lines
755 B
SQL

CREATE TABLE Orders (
OrderID int,
OrderDate date,
Status varchar(16),
DeliveryDate date,
Data nvarchar(4000)
)
CREATE TABLE OrderLines (
OrderLineID int,
OrderID int,
ProductID int,
Quantity int,
UnitPrice decimal,
TaxRate decimal
)
CREATE EXTERNAL DATA SOURCE MyAzureBlobStorage
WITH ( TYPE = BLOB_STORAGE, LOCATION = 'https://myazureblobstorage.blob.core.windows.net/data');
BULK INSERT Orders
FROM 'orders.bcp'
WITH ( DATA_SOURCE = 'MyAzureBlobStorage',
FORMATFILE = 'orders.fmt',
FORMATFILE_DATA_SOURCE = 'MyAzureBlobStorage',
TABLOCK);
BULK INSERT OrderLines
FROM 'orderlines.bcp'
WITH ( DATA_SOURCE = 'MyAzureBlobStorage',
FORMATFILE = 'orderlines.fmt',
FORMATFILE_DATA_SOURCE = 'MyAzureBlobStorage',
TABLOCK);