# `database/procedures/`

Stored procedures for the SQL Server side. Use sparingly — most read paths use EF Core projections (`AsNoTracking().Select(...)`), which are clearer to read and easier to evolve.

| Procedure                 | Purpose                                                   |
| ------------------------- | --------------------------------------------------------- |
| `sp_get_user_permissions` | Distinct permission codes for an active, non-deleted user |

When you need a procedure rather than a query:

- The operation is run from a SQL admin tool / dashboard that can't easily build the projection in EF.
- The operation must be a single statement for performance (`MERGE`, set-based update with a CTE, ...).
- A scheduled SQL Agent / cron job calls it (no app process needed).
