Skip to content

Commit 01ed636

Browse files
authored
Merge pull request #1 from Microsoft/master
update from original repo
2 parents ee66866 + 09a5451 commit 01ed636

File tree

38 files changed

+451
-20682
lines changed

38 files changed

+451
-20682
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
test_LFS.bak filter=lfs diff=lfs merge=lfs -text

samples/databases/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,8 @@ The new sample database for SQL Server 2016 and Azure SQL Database. It illustrat
99
__[contoso-data-warehouse](contoso-data-warehouse/)__
1010

1111
Sample data warehouse that illustrates loading data into Azure SQL Data Warehouse.
12+
13+
__[adventure-works-lt](adventure-works-lt/)__
14+
15+
AdventureWorksLT sample database.
16+
366 KB
Binary file not shown.

samples/demos/belgrade-product-catalog-demo/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ obj/*
99
Properties/PublishProfiles/*
1010
appsettings.Development.json
1111
appsettings.Production.json
12-
*.ndjson
12+
*.ndjson
13+
sql-scripts/bcp.sql.sql

samples/demos/belgrade-product-catalog-demo/Startup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public Startup(IHostingEnvironment env)
3131
Configuration = builder.Build();
3232
#if NETCOREAPP1_0
3333
Log.Logger = new LoggerConfiguration()
34-
.WriteTo.RollingFile(new Serilog.Formatting.Json.JsonFormatter(), System.IO.Path.Combine(env.ContentRootPath, "log-{Date}.ndjson"))
34+
.WriteTo.RollingFile(new Serilog.Formatting.Json.JsonFormatter(), System.IO.Path.Combine(env.ContentRootPath, "logs\\log-{Date}.ndjson"))
3535
.CreateLogger();
3636
#endif
3737
#if NET46
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
12.0
2+
1
3+
1 SQLCHAR 0 80000 "\r\n" 1 JSON SQL_Latin1_General_CP1_CI_AS

samples/demos/belgrade-product-catalog-demo/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"dependencies": {
3-
"Belgrade.Sql.Client": "0.6.5",
3+
"Belgrade.Sql.Client": "0.7",
44
"Microsoft.AspNetCore.Mvc": "1.0.0",
55
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
66
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<#@ output extension=".sql" #>
2+
<#@ template language="C#" hostspecific="True" #>
3+
4+
SELECT *
5+
FROM OPENROWSET(BULK '<#=this.Host.ResolvePath("..\\logs") #>\log-20170203.ndjson',
6+
FORMATFILE = '<#=this.Host.ResolvePath("..\\logs") #>\linedelimited.fmt' ) as logs;
7+
8+
9+
10+
DROP TABLE IF EXISTS Logs
11+
12+
--{"Timestamp":"2017-02-03T08:33:32.0776155+01:00","Level":"Information","MessageTemplate":"{HostingRequestFinished:l}","Properties":{"ElapsedMilliseconds":154.2332,"StatusCode":200,"ContentType":null,"HostingRequestFinished":"Request finished in 154.2332ms 200 ","EventId":{"Id":2},"SourceContext":"Microsoft.AspNetCore.Hosting.Internal.WebHost","RequestId":"0HL2C0RQ64LNN","RequestPath":"/"},"Renderings":{"HostingRequestFinished":[{"Format":"l","Rendering":"Request finished in 154.2332ms 200 "}]}}
13+
CREATE TABLE Logs (
14+
Data NVARCHAR(MAX),
15+
Timestamp AS CAST(JSON_VALUE(Data, '$.Timestamp') as datetime2),
16+
Level AS CAST(JSON_VALUE(Data, '$.Level') as nvarchar(40)),
17+
ElapsedMilliseconds AS CAST(JSON_VALUE(Data, '$.Properties.ElapsedMilliseconds') AS float),
18+
StatusCode AS CAST(JSON_VALUE(Data, '$.Properties.StatusCode') AS int)
19+
)
20+
21+
BULK INSERT Logs
22+
FROM '<#=this.Host.ResolvePath("..\\logs") #>\log-20170203.ndjson'
23+
WITH (FORMATFILE = '<#=this.Host.ResolvePath("..\\logs") #>\linedelimited.fmt')
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
**Instructions**
2+
3+
4+
- Copy the BCP data files & format file below to a local folder (ex: bcp folder from sample):
5+
6+
[orderlines.bcp](https://sqlchoice.blob.core.windows.net/sqlchoice/samples/belgrade-product-catalog-demo/bcp/orderlines.bcp)
7+
8+
[orderlines.fmt](https://sqlchoice.blob.core.windows.net/sqlchoice/samples/belgrade-product-catalog-demo/bcp/orderlines.fmt)
9+
10+
[orders.bcp](https://sqlchoice.blob.core.windows.net/sqlchoice/samples/belgrade-product-catalog-demo/bcp/orders.bcp)
11+
12+
[orders.fmt](https://sqlchoice.blob.core.windows.net/sqlchoice/samples/belgrade-product-catalog-demo/bcp/orders.fmt)
-12.6 MB
Binary file not shown.

0 commit comments

Comments
 (0)