Skip to content

Commit 1189a89

Browse files
committed
Merge remote-tracking branch 'refs/remotes/Microsoft/master'
2 parents 8ff13f0 + 58bd2e8 commit 1189a89

File tree

461 files changed

+166494
-75821
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

461 files changed

+166494
-75821
lines changed

.gitignore

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ samples/features/in-memory/ticket-reservations/packages/CircularGauge.1.0.0/Read
3737
samples/features/in-memory/ticket-reservations/TicketReservations/obj/Release/Model.xml
3838
samples/features/in-memory/ticket-reservations/DemoWorkload/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
3939
*.dat
40-
*.sln
4140

4241
*.user
4342
samples/features/in-memory/ticket-reservations/DemoWorkload/obj/Release/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
@@ -48,3 +47,27 @@ samples/databases/wide-world-importers/wwi-integration-etl/Daily ETL/obj/Develop
4847
samples/features/in-memory/ticket-reservations/DemoWorkload/obj/Debug/DemoWorkload.csproj.FileListAbsolute.txt
4948
samples/features/in-memory/iot-smart-grid/Db/obj/Release/Model.xml
5049
samples/applications/iot-smart-grid/DataGenerator/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
50+
samples/databases/wide-world-importers/workload-drivers/order-insert/MultithreadedOrderInsert/bin/Debug/MultithreadedOrderInsert.exe.config
51+
samples/features/in-memory/iot-smart-grid/ConsoleClient/bin/Release/ConsoleClient.exe.config
52+
*.jfm
53+
samples/features/in-memory/ticket-reservations/TicketReservations/bin/Release/TicketReservations.publish.sql
54+
samples/applications/iot-smart-grid/ConsoleClient/bin/Release/ConsoleClient.exe.config
55+
samples/applications/iot-smart-grid/Db/Db.dbmdl
56+
samples/databases/wide-world-importers/workload-drivers/order-insert/MultithreadedOrderInsert/obj/Release/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
57+
samples/databases/wide-world-importers/wwi-dw-ssdt/wwi-dw-ssdt/obj/Debug/Model.xml
58+
samples/databases/wide-world-importers/wwi-dw-ssdt/wwi-dw-ssdt/WideWorldImportersDW.dbmdl
59+
samples/features/in-memory/iot-smart-grid/WinFormsClient/bin/Release/Reports/PowerDashboard.pbix
60+
samples/databases/wide-world-importers/wwi-ssdt/wwi-ssdt/WideWorldImporters.dbmdl
61+
samples/databases/wide-world-importers/workload-drivers/order-insert/MultithreadedOrderInsert/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
62+
samples/databases/wide-world-importers/wwi-ssasmd/wwi-ssasmd/bin/WWI-SSASMD.asdatabase
63+
samples/applications/iot-smart-grid/Db/obj/Release/Db.sqlproj.FileListAbsolute.txt
64+
*.manifest
65+
samples/applications/iot-smart-grid/WinFormsClient/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
66+
samples/databases/wide-world-importers/wwi-ssasmd/wwi-ssasmd/obj/Development/IncrementalShapshot.xml
67+
samples/applications/iot-smart-grid/ConsoleClient/bin/Release/Reports/PowerDashboard.pbix
68+
samples/applications/iot-smart-grid/Db/obj/Release/Model.xml
69+
samples/databases/wide-world-importers/workload-drivers/order-insert/MultithreadedOrderInsert/obj/Release/MultithreadedOrderInsert.csproj.FileListAbsolute.txt
70+
samples/applications/iot-smart-grid/ConsoleClient/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
71+
samples/applications/iot-smart-grid/WinFormsClient/bin/Release/Client.exe.config
72+
samples/databases/wide-world-importers/workload-drivers/order-insert/MultithreadedOrderInsert/bin/Release/MultithreadedOrderInsert.exe.config
73+
samples/databases/wide-world-importers/workload-drivers/order-insert/MultithreadedOrderInsert/obj/Debug/MultithreadedInMemoryTableInsert.MultithreadedOrderInsertMain.resources
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Microsoft Visual Studio Solution File, Format Version 12.00
2+
# Visual Studio 15
3+
VisualStudioVersion = 15.0.26403.7
4+
MinimumVisualStudioVersion = 10.0.40219.1
5+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataGenerator", "DataGenerator\DataGenerator.csproj", "{D871B062-06A7-49E3-8BCD-8465B772FC52}"
6+
EndProject
7+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinFormsClient", "WinFormsClient\WinFormsClient.csproj", "{6C0E1820-A10B-47DA-B806-939CBCD0DD39}"
8+
EndProject
9+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{2D761B8A-EE55-4825-B19D-F3B04860D9D7}"
10+
ProjectSection(SolutionItems) = preProject
11+
App.config = App.config
12+
sample-sql-queries.sql = sample-sql-queries.sql
13+
setup_reset.sql = setup_reset.sql
14+
EndProjectSection
15+
EndProject
16+
Global
17+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
18+
Debug|Any CPU = Debug|Any CPU
19+
Release|Any CPU = Release|Any CPU
20+
EndGlobalSection
21+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
22+
{D871B062-06A7-49E3-8BCD-8465B772FC52}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
23+
{D871B062-06A7-49E3-8BCD-8465B772FC52}.Debug|Any CPU.Build.0 = Debug|Any CPU
24+
{D871B062-06A7-49E3-8BCD-8465B772FC52}.Release|Any CPU.ActiveCfg = Release|Any CPU
25+
{D871B062-06A7-49E3-8BCD-8465B772FC52}.Release|Any CPU.Build.0 = Release|Any CPU
26+
{6C0E1820-A10B-47DA-B806-939CBCD0DD39}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
27+
{6C0E1820-A10B-47DA-B806-939CBCD0DD39}.Debug|Any CPU.Build.0 = Debug|Any CPU
28+
{6C0E1820-A10B-47DA-B806-939CBCD0DD39}.Release|Any CPU.ActiveCfg = Release|Any CPU
29+
{6C0E1820-A10B-47DA-B806-939CBCD0DD39}.Release|Any CPU.Build.0 = Release|Any CPU
30+
EndGlobalSection
31+
GlobalSection(SolutionProperties) = preSolution
32+
HideSolutionNode = FALSE
33+
EndGlobalSection
34+
EndGlobal

samples/databases/README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,3 @@ 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/databases/wide-world-importers/README.md

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,11 @@ The sample includes the databases that can be explored, as well as sample applic
3030
1. **Key features:** Core database features
3131
1. **Workload:** OLTP, OLAP, IoT
3232
1. **Programming Language:** T-SQL, C#
33-
1. **Authors:** Greg Low, Denzil Ribeiro, Jos de Bruijn
34-
1. **Update history:** 25 May 2016 - initial revision
33+
1. **Authors:** Greg Low, Denzil Ribeiro, Jos de Bruijn, Robert Cain
34+
1. **Update history:**
35+
21 June 2017 - restructure using SSDT
36+
25 May 2016 - initial revision
37+
3538

3639
<a name=before-you-begin></a>
3740

@@ -43,39 +46,51 @@ To run this sample, you need the following prerequisites.
4346

4447
<!-- Examples -->
4548
1. SQL Server 2016 (or higher) or an Azure SQL Database.
46-
2. SQL Server Management Studio, preferably June 2016 release or later (version >= 13.0.15000.23).
47-
3. (to build sample apps) Visual Studio 2015.
48-
4. (to run ETL jobs) SQL Server 2016 Integration Services
49+
1. SQL Server Management Studio, preferably June 2016 release or later (version >= 13.0.15000.23).
50+
1. Visual Studio 2015 Update 3 (or higher) with SQL Server Data Tools.
51+
1. (to run ETL jobs) SQL Server 2016 (or higher) Integration Services (SSIS). At the time of writing, Visual Studio 2017 does not yet support Integration Services projects. You will need to install Visual Studio 2015 to open the SSIS project.
52+
1. (to install the SSASMD sample) SQL Server 2016 (or higher) Analysis Services (SSAS). If you are using Visual Studio 2017, download and install the following: [Analysis Services](https://marketplace.visualstudio.com/items?itemName=ProBITools.MicrosoftAnalysisServicesModelingProjects)
4953

5054
<a name=run-this-sample></a>
5155

5256
## Sample structure
5357

54-
The latest release of this sample is available here: TBD
58+
The latest release of this sample is available here: [wide-world-importers-release](http://go.microsoft.com/fwlink/?LinkID=800630)
59+
60+
This sample contains databases as well as a number of sample scripts and workload drivers.
61+
62+
The sample databases are created through SQL Server Data Tools projects in Visual Studio. Each database has its own project; the solution [wwi-sample.sln](wwi-sample.sln) in the root folder of the sample has references to all the projects. To load all project in the solution, SQL Server Integration Services and SQL Server Analysis Services need to be installed on the machine.
63+
64+
The sample scripts are available as Transact-SQL. The workload drivers are sample applications created in Visual Studio.
5565

56-
The source code for the sample is structured as follows:
66+
The source code for the sample is further structured as follows:
5767

58-
__[sample-scripts] (sample-scripts/)__
68+
__[sample-scripts](sample-scripts/)__
5969

6070
Sample scripts that illustrate the use of various SQL Server features with the WideWorldImporters sample database.
6171

62-
__[workload-drivers] (workload-drivers/)__
72+
__[workload-drivers](workload-drivers/)__
6373

6474
Simple apps that simulate workloads for the WideWorldImporters sample database.
6575

66-
__[wwi-database-scripts] (wwi-database-scripts/)__
76+
__[wwi-dw-ssdt](wwi-dw-ssdt/)__
6777

68-
T-SQL scripts to create the main WideWorldImporters database.
78+
SQL Server Data Tools project for the OLAP database WideWorldImporters.
6979

70-
__[wwi-dw-database-scripts] (wwi-dw-database-scripts/)__
80+
__[wwi-ssasmd](wwi-ssasmd/)__
7181

72-
T-SQL scripts to create the analytics database WideWorldImportersDW.
82+
SQL Server Analysis Services Multidimensional project to create the Analysis Services database WWI-SSASMD.
7383

74-
__[wwi-integration-etl] (wwi-integration-etl/)__
84+
__[wwi-ssdt](wwi-ssdt/)__
85+
86+
SQL Server Data Tools project for the main OLTP database WideWorldImporters.
87+
88+
__[wwi-ssis](wwi-ssis/)__
7589

7690
SQL Server Integration Services (SSIS) project for the Extract, Transform, and Load (ETL) process that takes data from the transactional database WideWorldImporters and loads it into the WideWorldImportersDW database.
7791

7892

93+
7994
<a name=disclaimers></a>
8095

8196
## Disclaimers

samples/databases/wide-world-importers/sample-scripts/always-encrypted/DemonstrateAlwaysEncrypted.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ GO
2929

3030
-- 1a. In Object Explorer, expand the security node in WideWorldImporters, then expand
3131
-- the Always Encrypted Keys node and note the contents.
32+
-- If you do not see the Always Encrypted node, install the latest version of Management Studio (17.X or higher): https://aka.ms/ssms
3233
-- 1b. Right-click the Column Master Keys node and click New Column Master Key.
3334
-- 1c. For the name, enter WWI_ColumnMasterKey.
3435
-- 1d. Note the available entries in the Key store dropdown list. Choose Windows Certificate Store - Current User.
20 Bytes
Binary file not shown.

samples/databases/wide-world-importers/sample-scripts/row-level-security/DemonstrateRLS.sql

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ GO
7878

7979
GRANT SELECT, UPDATE ON Sales.Customers TO [Great Lakes Sales];
8080
GRANT SELECT ON [Application].Cities TO [Great Lakes Sales];
81+
GRANT SELECT ON [Application].StateProvinces TO [Great Lakes Sales];
8182
GRANT SELECT ON [Application].Countries TO [Great Lakes Sales];
8283
GO
8384

@@ -94,20 +95,37 @@ GO
9495
-- where are those customers?
9596
-- note the spatial results tab
9697

97-
SELECT c.Border
98+
SELECT c.Border
9899
FROM [Application].Countries AS c
99100
WHERE c.CountryName = N'United States'
100101
UNION ALL
101-
SELECT c.DeliveryLocation
102-
FROM Sales.Customers AS c;
102+
SELECT c.DeliveryLocation
103+
FROM Sales.Customers AS c
103104
GO
104105

106+
-----------------------------------------------------------------------
105107
-- updating rows that are accessible to a non-accessible row is blocked
108+
-----------------------------------------------------------------------
109+
DECLARE @GreatLakesCustomerID INT
110+
DECLARE @NonGreatLakesCityID INT
106111

107-
UPDATE Sales.Customers -- Attempt to update
108-
SET DeliveryCityID = 3 -- to a city that is not in the Great Lakes Sales Territory
109-
WHERE DeliveryCityID = 32887; -- for a customer that is in the Great Lakes Sales Territory
112+
-- pick a customer in the Great Lakes sales territory
113+
SELECT TOP 1 @GreatLakesCustomerID=c.CustomerID
114+
FROM Sales.Customers c JOIN Application.Cities ci ON c.DeliveryCityID=ci.CityID
115+
JOIN Application.StateProvinces sp ON ci.StateProvinceID=sp.StateProvinceID
116+
WHERE sp.SalesTerritory=N'Great Lakes'
110117

118+
-- pick a City outside of the Great Lakes sales territory
119+
SELECT @NonGreatLakesCityID=c.CityID
120+
FROM Application.Cities c JOIN Application.StateProvinces sp ON c.StateProvinceID=sp.StateProvinceID
121+
WHERE CityName=N'Seattle' AND sp.StateProvinceCode=N'WA'
122+
123+
UPDATE Sales.Customers -- Attempt to update
124+
SET DeliveryCityID = @NonGreatLakesCityID -- to a city that is not in the Great Lakes Sales Territory
125+
WHERE CustomerID = @GreatLakesCustomerID; -- for a customer that is in the Great Lakes Sales Territory
126+
GO
127+
128+
-- revert the impersonation
111129
REVERT;
112130
GO
113131

@@ -133,9 +151,6 @@ REVOKE SELECT ON [Application].Cities FROM [Website];
133151
REVOKE SELECT ON [Application].Countries FROM [Website];
134152
GO
135153
136-
EXEC [Application].Configuration_RemoveRowLevelSecurity;
137-
GO
138-
139154
DROP USER GreatLakesUser;
140155
GO
141156

0 commit comments

Comments
 (0)