Thanks for adding to the field guide. A contribution should be understandable without access to the project where the query originated.
- Put the file in the correct engine folder.
- Use a descriptive
PascalCase.sqlfilename. - Keep one primary task per script.
- Remove company, customer, product, host, server, and internal database names.
- Remove credentials, tokens, connection strings, IP addresses, emails, and production data.
- Replace business-specific tables and columns with neutral examples.
- Prefer a read-only diagnostic or command generator when automatic mutation is unnecessary.
- Test with the oldest engine version named in the header.
/*
Purpose:
- Describe the question answered or operation performed.
Safety:
- Read-only | Generates commands | Changes state.
- Call out locks, scans, elevated permissions, or destructive behavior.
Requirements:
- Database engine and minimum version.
- Required permissions or extensions.
Customization:
- List every placeholder or threshold that should be reviewed.
*/Use angle-bracket placeholders for values that cannot run as-is:
USE [<DATABASE_NAME>];
-- <SCHEMA_NAME>, <TABLE_NAME>, <LOGIN_NAME>Use neutral executable objects only when they make the example easier to understand: dbo.Orders, app.Customer, or reporting_reader.
Before opening a pull request, search the changed files for:
password= pwd= user id= data source= initial catalog=
http:// 10.x.x.x 172.16-31.x.x 192.168.x.x
Also review every USE, three-part object name, CREATE USER, CREATE LOGIN, ALTER, DROP, DELETE, UPDATE, KILL, and server-level trigger by hand.