Skip to content

Instantly share code, notes, and snippets.

View lowlydba's full-sized avatar
☺️
don't forget to take an occasional https://mentalhealth.day

John McCall lowlydba

☺️
don't forget to take an occasional https://mentalhealth.day
View GitHub Profile
@lowlydba
lowlydba / datadog_sqlserver_custom_metrics.yaml
Last active December 6, 2024 13:34
Sample custom queries for Datadog's SQL Server integration
init_config:
global_custom_queries:
# Status of most recent Agent Job executions
# https://learn.microsoft.com/en-us/sql/relational-databases/system-tables/dbo-sysjobservers-transact-sql
- query: |
SELECT j.name [job_name],
js.last_run_outcome,
CASE js.last_run_outcome
WHEN 0 THEN 'FAIL'
WHEN 1 THEN 'SUCCEED'
@lowlydba
lowlydba / resume.json
Last active September 5, 2025 16:17
resume.json
{
"$schema": "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json",
"basics": {
"name": "John McCall",
"label": "A lot of my work is just kintsugi on a computer",
"image": "https://raw.githubusercontent.com/lowlydba/LowlyDBA/e193e85345d532395ce8a94365776d02d12d79fd/16843041.jpeg",
"email": "john@lowlydba.com",
"website": "https://lowlydba.com",
"summary": "Passionate, driven, and detail oriented when it comes to data and reliability engineering. Specializing in observability, scaling, and tuning complex systems with specialized data. Extra credit for positions at non-profits, B Corps, and companies that practice altruism. See Github profile for latest projects and contributions. I do not work with Oracle, SQL Server Reporting Services (SSRS), or SQL Server Integration Services (SSIS).",
"location": {
@lowlydba
lowlydba / tsqllint_output.txt
Created November 14, 2020 17:47
TSQLLint Sample Output
sp_test.sql(1,1): error set-nocount : Expected SET NOCOUNT ON near top of file.
sp_test.sql(1,1): error set-quoted-identifier : Expected SET QUOTED_IDENTIFIER ON near top of file.
Linted 1 files in 0.3037423 seconds
2 Errors.
0 Warnings
![Azure SQL](https://img.shields.io/badge/Azure%20SQL-vCurrent-blue?logo=data:image/svg+xml;base64,PHN2ZyBkYXRhLXNsdWctaWQ9InNxbC1kYXRhYmFzZS1ibHVlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0OSA0OSI+DQogIDxwYXRoIGQ9Im02LjQwNDIxIDcuNDA0NDJ2MzQuMTk1NzhjMCAzLjUyNDMgNy44ODk2OSA2LjQ3NzIgMTcuNjgwMzkgNi40Nzcydi00MC42NzI5OHoiIGZpbGw9IiM4MDgwODAiLz4NCiAgPHBhdGggZD0ibTIzLjg5NDYgNDguMDc3NGguMjg1MmM5Ljc5MDcgMCAxNy42ODA0LTIuODU3NiAxNy42ODA0LTYuNDc3MnYtMzQuMTk1NzhoLTE3Ljk2NTZ6IiBmaWxsPSIjODA4MDgwIi8+DQogIDxwYXRoIGQ9Im0yMy43MDQzIDQ4LjA3NzloLjI4NTJjOS44ODU4IDAgMTcuOTY1Ni0yLjg1NzYgMTcuOTY1Ni02LjQ3NzJ2LTM0LjI5MTAxaC0xOC4xNTU3eiIgZmlsbD0iIzgwODA4MCIvPg0KICA8cGF0aCBkPSJtNDEuODU4NCA3LjQwNTUzYzAgMy41MjQzNy03Ljg4OTcgNi40NzcxNy0xNy42ODA1IDYuNDc3MTctOS43OTA3IDAtMTcuNjgwMzktMi44NTc2LTE3LjY4MDM5LTYuNDc3MTcgMC0zLjYxOTYgNy44ODk2OS02LjQ3NzE4NSAxNy42ODAzOS02LjQ3NzE4NSA5Ljc5MDggMCAxNy42ODA1IDIuOTUyODM1IDE3LjY4MDUgNi40NzcxODV6IiBmaWxsPSIjZmZmIi8+PHBhdGggZD0ibTM4LjI0ODEgNy4wMjM4YzAgMi4zODEzMi02LjI3MzcgNC4yODY0LTE0LjA2O
@lowlydba
lowlydba / sql-server-all-enable-dynamic-tcp.ps1
Last active February 21, 2025 08:45 — forked from FeodorFitsner/sql-server-all-enable-dynamic-tcp.ps1
Enable dynamic TCP ports for all SQL Server instances (so they can be run simultaneously)
# SQL 2008R2
set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql10_50.SQL2008R2SP2\mssqlserver\supersocketnetlib\tcp\ipall' -name TcpDynamicPorts -value '0'
set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql10_50.SQL2008R2SP2\mssqlserver\supersocketnetlib\tcp\ipall' -name TcpPort -value ''
# SQL 2012
set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql11.SQL2012SP1\mssqlserver\supersocketnetlib\tcp\ipall' -name TcpDynamicPorts -value '0'
set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql11.SQL2012SP1\mssqlserver\supersocketnetlib\tcp\ipall' -name TcpPort -value ''
# SQL 2014
set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql12.SQL2014\mssqlserver\supersocketnetlib\tcp\ipall' -name TcpDynamicPorts -value '0'
@lowlydba
lowlydba / simple-sql-server-express-backup-script.sql
Created April 15, 2018 17:30
Sample backup schedule for SQL Server Express, using Ola Hallengren's scripts, for simple recovery mode
/* Daily Full Backup with Simple Recovery Mode*/
EXECUTE dbo.DatabaseBackup
@Databases = 'USER_DATABASES',
@Directory = 'C:\Backup',
@BackupType = 'FULL',
@Compess = 'Y',
@LogToTable = 'Y',
@CleanupTime = 72, --3 days
@CleanupMode = 'AFTER_BACKUP',
@Verify = 'Y'
@lowlydba
lowlydba / sql-express-ola-backup-sample-schedule-low-rto.sql
Created April 15, 2018 17:29
Sample backup schedule for SQL Server Express, using Ola Hallengren's scripts, for a low RTO / highly transactional database
/* Daily Full Backup */
EXECUTE dbo.DatabaseBackup
@Databases = 'USER_DATABASES',
@Directory = 'C:\Backup',
@BackupType = 'FULL',
@Compess = 'Y',
@LogToTable = 'Y',
@CleanupTime = 48, --3 days
@CleanupMode = 'AFTER_BACKUP',
@Verify = 'Y'
@lowlydba
lowlydba / sql-express-ola-backup-sample-schedule.sql
Created April 15, 2018 17:26
Sample backup schedule for SQL Server Express, using Ola Hallengren's scripts
/* Weekly Full Backup */
EXECUTE dbo.DatabaseBackup
@Databases = 'USER_DATABASES',
@Directory = 'C:\Backup',
@BackupType = 'FULL',
@Compess = 'Y',
@LogToTable = 'Y',
@CleanupTime = 336, --14 days
@CleanupMode = 'AFTER_BACKUP',
@Verify = 'Y'