Appearance
Auto‑format on Execute
Automatically format your SQL right before execution in SSMS.
Enable it
- Use the StyleSQL toolbar toggle: "Style on Execute".
- You can also enable it from the Tools menu. In Settings, you can optionally enable related options.
How it works
- When you run a query, StyleSQL reformats the text, then SSMS executes it.
- If a selection is highlighted, only that region is formatted/executed.
Related options (Settings)
- DDL only — Restricts auto‑formatting to DDL (CREATE/ALTER), leaving ad‑hoc queries like SELECTs untouched.
- Restore original — After formatting and execution, returns the editor contents to the exact text you had before running the query. Great when you want consistent execution formatting without changing your working buffer.
Tips
- Use Undo (Ctrl+Z) if you want to revert the formatted editor text after an execution pass.
- Pair with Customizable Formatting to match your team’s conventions.