Skip to content

SQL-Skripte dokumentieren und Beispiele überarbeiten - #2

Merged
Rauchendraser merged 2 commits into
mainfrom
copilot/format-sql-files
Oct 3, 2026
Merged

Rauchendraser merged 2 commits into
mainfrom
copilot/format-sql-files

Conversation

Copilot AI commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Die 29 SQL-Dateien erhalten am Anfang eine Beschreibung ihres Themas. Ausgewählte T-SQL-Beispiele wurden formatiert, sprachlich überarbeitet und mit Erläuterungen versehen.

  • Dateibeschreibungen: Zweck, Inhalt und relevante Anwendungshinweise ergänzt.
  • Beispiele: Unter anderem MAXDOP, Sicherungen, Snapshots, Datenbankoptionen, Wartestatistiken, Sperren und Dateigruppen überarbeitet.
  • Upstream-Skripte: Code, Attribution und Lizenzhinweise von Ola Hallengren und Glenn Berry beibehalten.

Beispiel für die neuen Dateiheader:

/*
Zweck: Auswertung kumulierter SQL-Server-Wartestatistiken.
Die Abfrage berechnet Wartezeiten und Anteile; DMV-Werte
müssen im Kontext interpretiert werden.
*/

Copilot AI and others added 2 commits October 3, 2026 09:06
Co-authored-by: Rauchendraser <29091752+Rauchendraser@users.noreply.github.com>
Co-authored-by: Rauchendraser <29091752+Rauchendraser@users.noreply.github.com>
@Rauchendraser
Rauchendraser marked this pull request as ready for review October 3, 2026 09:24
Copilot AI balanced review requested due to automatic review settings October 3, 2026 09:24
@Rauchendraser
Rauchendraser merged commit 327029f into main Oct 3, 2026
@Rauchendraser
Rauchendraser deleted the copilot/format-sql-files branch October 3, 2026 09:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Both snapshot restore examples use invalid DATABASE_SNAPSHOT syntax, and one session query is duplicated.

Review effort: Balanced
Findings: 1 High severity · 1 Low severity

Open (2)
What changed in this PR

Adds documentation headers and improves the readability and safety guidance of the SQL Server training scripts.

Changes:

  • Documents each script’s purpose, prerequisites, and operational risks.
  • Reformats examples covering backups, snapshots, locking, monitoring, and configuration.
  • Preserves upstream attribution and licensing notices.
File Description
Spieltabelle.sql Formats the customer revenue view.
Modul12Locks/​0012_Momentaufnahmenisolation.sql Documents snapshot isolation.
Modul12Locks/​0012_Locks setzen.sql Clarifies locking examples.
Modul11IndizesStatistiken/​51_forward_record_Count.sql Documents forwarded-record analysis.
Modul11IndizesStatistiken/​50_Indizes.sql Adds index-design guidance.
Modul11IndizesStatistiken/​07_Statistiken.sql Documents statistics concepts.
Modul11IndizesStatistiken/​07 Fehlende Indizes.sql Clarifies missing-index recommendations.
Modul10Monitoring/​Z_SQL Server 2022 Diagnostic Information Queries.sql Adds an upstream-script header.
Modul10Monitoring/​z_Perfmon_Indikatoren.sql Documents performance counters.
Modul10Monitoring/​40_Monitoring.sql Introduces monitoring guidance.
Modul10Monitoring/​10_Werkzeuge.sql Documents diagnostic tools.
Modul10Monitoring/​10_WAIT_STATS.sql Reformats wait-statistics analysis.
Modul10Monitoring/​10_QueryStore.sql Documents Query Store concepts.
Modul05BackupSnapshot/​Snapshot.sql Reworks snapshot examples.
Modul05BackupSnapshot/​Backup.sql Rewrites backup and restore guidance.
Modul03DBSettings/​Partitionierung.sql Documents partitioning examples.
Modul03DBSettings/​DBSettings.sql Adds database-settings guidance.
Modul03DBSettings/​DBObjekte.sql Documents database-object comparisons.
Modul03DBSettings/​Dateigruppen.sql Formats filegroup creation examples.
Modul03DBSettings/​04_DBobjekte.sql Clarifies object-performance notes.
Modul03DBSettings/​03_DBSettings.sql Formats database-option examples.
Modul02SystemDBs/​05_SystemDBs.sql Reworks system-database notes.
Modul01ServerSetup/​02_Setup.sql Documents setup considerations.
Modul01ServerSetup/​02_MAXDOP.sql Rewrites MAXDOP examples.
Modul01ServerSetup/​01_Virtualisierung.sql Documents virtualization guidance.
Modul01ServerSetup/​01_Installation.sql Adds installation-planning guidance.
MaintenanceSolution.sql Adds an upstream maintenance header.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.


-- Stellt Northwind auf den Stand des Snapshots zurueck.
RESTORE DATABASE [Northwind]
FROM DATABASE_SNAPSHOT = [SN_Northwind_1152];
Comment on lines +80 to +84
-- Alternativ nur Sitzungen der Quelldatenbank und des Snapshots anzeigen.
SELECT *
FROM sysprocesses
WHERE spid > 50
AND dbid IN (DB_ID(N'Northwind'), DB_ID(N'nw_1616'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants