Skip to content

Commit 9740f4d

Browse files
authored
Merge pull request #1 from Microsoft/master
pull latest from Microsoft/sql-server-samples
2 parents 356da36 + cf06428 commit 9740f4d

1,557 files changed

Lines changed: 319366 additions & 77404 deletions

File tree

Some content is hidden

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

.gitignore

Lines changed: 85 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
## Ignore Visual Studio temporary files, build results, and
22
## files generated by popular Visual Studio add-ons.
3-
##
4-
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
53

64
# User-specific files
75
*.suo
@@ -19,10 +17,10 @@
1917
[Rr]eleases/
2018
x64/
2119
x86/
20+
build/
2221
bld/
2322
[Bb]in/
2423
[Oo]bj/
25-
[Ll]og/
2624

2725
# Visual Studio 2015 cache/options directory
2826
.vs/
@@ -50,6 +48,9 @@ project.lock.json
5048
project.fragment.lock.json
5149
artifacts/
5250
**/Properties/launchSettings.json
51+
# DNX
52+
project.lock.json
53+
artifacts/
5354

5455
*_i.c
5556
*_p.c
@@ -89,6 +90,9 @@ ipch/
8990
*.cachefile
9091
*.VC.db
9192
*.VC.VC.opendb
93+
*.opensdf
94+
*.sdf
95+
*.cachefile
9296

9397
# Visual Studio profiler
9498
*.psess
@@ -153,47 +157,30 @@ DocProject/Help/Html2
153157
DocProject/Help/html
154158

155159
# Click-Once directory
156-
#publish/
160+
# publish/
157161

158162
# Publish Web Output
159-
#*.[Pp]ublish.xml
160163
*.azurePubxml
161-
# Note: Comment the next line if you want to checkin your web deploy settings,
164+
# TODO: Comment the next line if you want to checkin your web deploy settings
162165
# but database connection strings (with potential passwords) will be unencrypted
163166
*.pubxml
164167
*.publishproj
165168

166-
# Microsoft Azure Web App publish settings. Comment the next line if you want to
167-
# checkin your Azure Web App publish settings, but sensitive information contained
168-
# in these scripts will be unencrypted
169-
PublishScripts/
170-
171169
# NuGet Packages
172170
*.nupkg
173171
# The packages folder can be ignored because of Package Restore
174-
**/[Pp]ackages/*
172+
**/packages/*
175173
# except build/, which is used as an MSBuild target.
176-
!**/[Pp]ackages/build/
174+
!**/packages/build/
177175
# Uncomment if necessary however generally it will be regenerated when needed
178-
#!**/[Pp]ackages/repositories.config
179-
# NuGet v3's project.json files produces more ignorable files
180-
*.nuget.props
181-
*.nuget.targets
176+
#!**/packages/repositories.config
182177

183-
# Microsoft Azure Build Output
178+
# Windows Azure Build Output
184179
csx/
185180
*.build.csdef
186181

187-
# Microsoft Azure Emulator
188-
ecf/
189-
rcf/
190-
191-
# Windows Store app package directories and files
182+
# Windows Store app package directory
192183
AppPackages/
193-
BundleArtifacts/
194-
Package.StoreAssociation.xml
195-
_pkginfo.txt
196-
*.appx
197184

198185
# Visual Studio cache files
199186
# files ending in .cache can be ignored
@@ -203,6 +190,7 @@ _pkginfo.txt
203190

204191
# Others
205192
ClientBin/
193+
[Ss]tyle[Cc]op.*
206194
~$*
207195
*~
208196
*.dbmdl
@@ -216,6 +204,11 @@ orleans.codegen.cs
216204
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
217205
#bower_components/
218206

207+
*.pfx
208+
*.publishsettings
209+
node_modules/
210+
orleans.codegen.cs
211+
219212
# RIA/Silverlight projects
220213
Generated_Code/
221214

@@ -249,6 +242,8 @@ node_modules/
249242

250243
# Typescript v1 declaration files
251244
typings/
245+
# Node.js Tools for Visual Studio
246+
.ntvs_analysis.dat
252247

253248
# Visual Studio 6 build log
254249
*.plg
@@ -304,6 +299,61 @@ __pycache__/
304299
# OpenCover UI analysis results
305300
OpenCover/
306301

302+
/build
303+
/Build
304+
/deploy
305+
/package
306+
bin/
307+
obj/
308+
sql/
309+
*/obj/debug
310+
**/Debug
311+
#ignore thumbnails created by windows
312+
Thumbs.db
313+
#Ignore files build by Visual Studio
314+
*.obj
315+
*.pdb
316+
*.user
317+
*.aps
318+
*.pch
319+
*.docstates
320+
*.vspscc
321+
*_i.c
322+
*_p.c
323+
*.ncb
324+
*.suo
325+
*.tlb
326+
*.dbmdl
327+
*.schemaview
328+
*.tlh
329+
*.cache
330+
*.ilk
331+
*.log
332+
[Bb]in
333+
[Dd]ebug*/
334+
*.lib
335+
*.sbr
336+
obj/
337+
[Rr]elease*/
338+
_ReSharper*/
339+
[Tt]est[Rr]esult*
340+
*.docstates
341+
*.swp
342+
*.*~
343+
*.gpState
344+
*.ReSharper*
345+
*.preflight
346+
*.nocommit
347+
#Ignore Recovery Files made by Excel
348+
~$*.xlsx
349+
*.rdl.data
350+
351+
*.jfm
352+
353+
#======================================================================================
354+
# The below section could possibly be removed as these should be ignored by the above.
355+
#======================================================================================
356+
307357
samples/in-memory/ticket-reservations/DemoWorkload/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
308358
*.nupkg
309359
samples/in-memory/ticket-reservations/packages/CircularGauge.1.0.0/CreatePackageFile.bat
@@ -377,3 +427,11 @@ samples/applications/iot-smart-grid/ConsoleClient/obj/Debug/TemporaryGeneratedFi
377427
samples/applications/iot-smart-grid/WinFormsClient/bin/Release/Client.exe.config
378428
samples/databases/wide-world-importers/workload-drivers/order-insert/MultithreadedOrderInsert/bin/Release/MultithreadedOrderInsert.exe.config
379429
samples/databases/wide-world-importers/workload-drivers/order-insert/MultithreadedOrderInsert/obj/Debug/MultithreadedInMemoryTableInsert.MultithreadedOrderInsertMain.resources
430+
/samples/features/epm-framework/5.0/2Reporting/PolicyReports/PolicyEvaluationErrors.rdl.data
431+
/samples/features/epm-framework/5.0/2Reporting/PolicyReports/PolicyEvaluationErrorDetails.rdl.data
432+
/samples/features/epm-framework/5.0/2Reporting/PolicyReports/PolicyEvaluationDetails.rdl.data
433+
/samples/features/epm-framework/5.0/2Reporting/PolicyReports/PolicyDetails.rdl.data
434+
/samples/features/epm-framework/5.0/2Reporting/PolicyReports/PolicyDashboard.rdl.data
435+
/samples/features/epm-framework/5.0/2Reporting/PolicyReports/bin/Debug
436+
/samples/features/epm-framework/5.0/2Reporting/PolicyReports/PolicyDashboard - Backup.rdl
437+
/samples/features/epm-framework/5.0/2Reporting/PolicyReports/PolicyDashboardFiltered.rdl.data

media/auto-tuning.png

17 KB
Loading
148 KB
Loading

samples/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Sample Categories
22

3-
__[applications](applications/)__
4-
53
End-to-end sample applications that illustrate the use of SQL Server for specific application scenarios.
64

75
__[databases](databases/)__
@@ -22,4 +20,8 @@ Samples that help with the management of SQL Server and Azure SQL Database.
2220

2321
__[tutorials](tutorials/)__
2422

25-
Samples showing how to connect to SQL databases using various programming languages, including Python, C#, Java, Ruby, Node.js, and PHP.
23+
Samples showing how to connect to SQL databases using various programming languages, including Python, C#, F#, Java, Ruby, Node.js, and PHP.
24+
25+
__[containers](containers/)__
26+
27+
Samples showing various SQL Server in container scenarios.

samples/applications/aspnet-session-state/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,6 @@ The code included in this sample is not intended to be a set of best practices o
6060
For more information, see these articles:
6161

6262
- [In-Memory OLTP (In-Memory Optimization)](https://msdn.microsoft.com/en-us/library/dn133186.aspx)
63-
- [OLTP and database management](https://www.microsoft.com/en-us/server-cloud/solutions/oltp-database-management.aspx)
63+
- [OLTP and database management](https://www.microsoft.com/en-us/sql-server/oltp-database-management)
6464
- [Session State Provider](https://msdn.microsoft.com/en-us/library/aa478952.aspx)
6565
- [Implementing a Session-State Store Provider](https://msdn.microsoft.com/en-us/library/ms178587.aspx)
Binary file not shown.
Binary file not shown.

samples/containers/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
__[replication](replication/)__
2+
3+
Example of SQL Server Replication in containers. This demo uses docker-compose to start two SQL Server containers; one that acts as the publisher and distributor, and the other as the subscriber in a push snapshot configuration.

samples/containers/dtc/README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
## SQL Server Replication with Containers
2+
3+
This demo uses docker-compose to start two SQL Server containers; one that acts as the publisher and distributor, and the other as the subscriber in a push snapshot configuration.
4+
5+
6+
### How to Use
7+
8+
1. Run the following command in this directory:
9+
10+
```
11+
docker-compose up
12+
```
13+
note: this will take approx. 2 min.
14+
15+
In your terminal, you should see something like this
16+
```
17+
db1 | Job 'DB1-Sales-SnapshotRepl-1' started successfully.
18+
db1 | Creating Snapshot...
19+
db1 | Job 'db1-Sales-SnapshotRepl-DB2-1' started successfully.
20+
```
21+
22+
2. Connect to the subscriber listening on localhost,2600 and see that the Sales Database has a Customer table with data in it.
23+
note: credentials are listed in the **docker-compose.yml**
24+
25+
3. when you are done, clean up by running the following command
26+
```
27+
docker-compose down
28+
```
29+
30+
31+
32+
### How it Works
33+
34+
1. Both SQL Server containers start with the environment variables specified in the docker-compose file. In this example, **db1** is the publisher/distributor and **db2** is the subscriber.
35+
2. *db1/db-init.sh* and *db2/db-init.sh* waits for SQL Server to start up and run the *db-init.sql* scripts
36+
3. *db1/db-init.sql* creates a *Sales* Database with *Customer* table and sample data, and proceeds by setting up snapshot replication.
37+
4. *db2/db-init.sql* creates a *Sales* Database.
38+
5. db1 starts replication jobs to push the snapshot to db2
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
version: "3"
2+
services:
3+
dtc1:
4+
build: ./dtc1
5+
environment:
6+
SA_PASSWORD: "Sql2019isfast"
7+
ACCEPT_EULA: "Y"
8+
MSSQL_AGENT_ENABLED: "true"
9+
MSSQL_RPC_PORT: 135
10+
MSSQL_DTC_TCP_PORT: 51999
11+
ports:
12+
- "1401:1433"
13+
- "135:135"
14+
- "51999:51999"
15+
container_name: dtc1
16+
hostname: dtc1
17+
dtc2:
18+
build: ./dtc2
19+
environment:
20+
SA_PASSWORD: "Sql2019isfast"
21+
ACCEPT_EULA: "Y"
22+
MSSQL_AGENT_ENABLED: "true"
23+
MSSQL_RPC_PORT: 135
24+
MSSQL_DTC_TCP_PORT: 51999
25+
ports:
26+
- "1402:1433"
27+
- "136:135"
28+
- "51998:51999"
29+
container_name: dtc2
30+
hostname: dtc2
31+
32+

0 commit comments

Comments
 (0)