Pcornel
Databases

Microsoft SQL Server

Cheat sheet · https://pcornel.dk/topic.php?topic=6092

Back to the Topic

Answer

Microsoft SQL Server is a relational database engine for Windows and Linux, managed with SSMS, sqlcmd and PowerShell (dbatools), with SQL Agent, Always On and rich DMVs.

Remember

Set max server memory, check recovery models and log backups, monitor waits (sys.dm_os_wait_stats), and use Query Store for plan regressions.

First checks

  • SELECT * FROM sys.dm_exec_requests; — running requests
  • psql -c "SELECT now(), version();" — PostgreSQL reachable and version
  • mysql -e "SELECT NOW(), VERSION();" — MariaDB/MySQL reachable and version
  • sqlcmd -S <server> -Q "SELECT @@VERSION" — SQL Server reachable and version

Verify in this order

client → TDS (1433) → auth → engine → buffer pool/log → data files

Where it usually breaks

Typical failures are connecting to the wrong instance, full transaction logs caused by missing log backups or blocked truncation, broken backup chains, database recovery states, authentication mode/SPN issues and confusing AG synchronization with application reachability.

Microsoft SQL Server verification boundary matrix

BoundaryInspectHealthy interpretationDo not infer
IntentInstances and databasesIntended object/scope is explicit and versioned where relevantIntent is already effective
Owning runtime/control planeServices and authentication modes / Data/log filesOwner accepts and reports the expected object stateDownstream dependencies are healthy
Effective stateTransaction logIndependent read-back matches the intended stateEvery client sees the same result
Consumer outcomeRecovery modelsThe original bounded check succeeds in the same time windowProduction correctness outside this scope

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=6092

Confirmation

Confirm action

Continue?