CAST to date keeps the calendar day from a typed datetime2 value. The example preserves the original time and contrasts actual removal with a display that merely hides it.
LEAD Defaults: Missing Rows Differ From NULL Values
LEAD defaults handle a missing following row. Keep that boundary separate from a present row containing NULL and choose replacement policy explicitly.
Validate an XML Document in T-SQL With an XSD Schema by Jacob Sebastian
To validate an XML document in SQL Server, store an XSD in a schema collection and type the variable or column with it. Jacob Sebastian’s lesson is kept, and I added tests on SQL Server 2025 that show the error number for each kind of bad document and what DOCUMENT and CONTENT accept.
What Is Installed? Finding Every SQL Server Component
Finding every SQL Server component starts with the Setup discovery report, then checks services, engine versions, and separate client tools.
Pre-Aggregating Data for Fast Dashboards
Pre-aggregating data can make dashboards fast through summary tables or indexed views when grain, refresh, and reader consistency are clear.
SQL SERVER – Comma Separated Values (CSV) from Table Column
The script I use most often to build Comma Separated Values (CSV) from a table column with FOR XML PATH. I think XML is the best option for code and speed.
TDE, Column Encryption and Always Encrypted Compared
Compare SQL Server encryption options by the threat they address, where keys live, what applications must change, and how recovery is tested.







