Patching an Availability Group safely means updating secondaries first, checking synchronization, failing over, and updating the old primary.
SQL SERVER – 2008 – Find If Index is Being Used in Database
How do you find if an index is being used in your database? My quick script checks sys.dm_db_index_usage_stats, so you can drop unused indexes safely.
What Is a Database Schema in SQL Server?
A database schema is a namespace inside a database. What dbo really is, why two tables can carry the same name, how a schema makes permissions something you set once, and why naming it in your code saves you from odd bugs.
Exploring the System Catalog With Queries
Exploring the system catalog with queries reveals SQL Server objects, columns, indexes, and dependencies without relying on stale diagrams.
DATETIMEOFFSETFROMPARTS: Build an Explicit Offset
DATETIMEOFFSETFROMPARTS constructs a local clock with an explicit offset. Keep both component signs consistent and validate the complete input.
PIVOT and UNPIVOT: Aggregation, NULLs and Cross-Tab Queries
PIVOT and UNPIVOT reshape SQL Server data. See a tested example, disappearing NULLs, aggregation and fixed cross-tab columns.
Responding to a SQL Server Security Bulletin
A SQL Server Security Bulletin should trigger exposure checks, ordered patching, verified recovery, and a clear management update.
SQL SERVER – Renaming SP is Not Good Idea – Renaming Stored Procedure Does Not Update sys.procedures
Renaming Stored Procedure objects with sp_rename looks fine, but the stored definition keeps the old name, as sp_helptext shows. A quick demo on AdventureWorks.
SQL SERVER – Puzzle – Computed Columns Datatype Explanation
Jacob Sebastian explains that SQL Server casts to the data type with the highest precedence. That leads to my puzzle on computed columns datatype.










