SQL Server Deadlocks: How to Capture, Read and Fix Them
How to find SQL Server deadlocks in the system_health session, read the deadlock graph, fix the usual causes (table order, indexes, UPDLOCK, short transactions) and retry error 1205 safely.
How to find SQL Server deadlocks in the system_health session, read the deadlock graph, fix the usual causes (table order, indexes, UPDLOCK, short transactions) and retry error 1205 safely.
How to compare this month with last month and with the same month last year in SQL: LAG for month-over-month, a safe date join for year-over-year, year-to-date totals, and the missing-month trap.
Temp table, table variable or CTE? How each one really works in SQL Server, why table variables can get a 1-row estimate, why a CTE can run twice, and a simple rule for choosing.
Use parameters in Delphi SQL queries with FireDAC and ADO: ParamByName, data types, NULLs, dates, LIKE, INSERT, and how they stop SQL injection.
How to turn rows into columns in SQL: conditional aggregation that works everywhere, the SQL Server PIVOT operator, dynamic pivot, and two ways to unpivot (without losing NULLs).
Why a query suddenly gets slow after a data load: how SQL Server statistics work, how to compare estimated and actual rows, check when stats were last updated, and keep them fresh.
Connect Delphi to SQL Server with FireDAC: TFDConnection settings, Windows vs SQL login, connecting in code, the ADO alternative and common errors.
The same question answered with EXISTS, IN and JOIN: when each one is right, why JOIN can duplicate rows, the NOT IN NULL trap, and what really matters for speed.
Build an accounts receivable aging report in SQL Server step by step: open amount per invoice, days overdue, aging buckets per customer, totals, and common mistakes.
Calculate averages, medians, percentiles, mode and standard deviation in SQL Server and MySQL, find outliers, and learn which number to report.