To count rows and indexes for every table, one query on the catalog views answers four questions at once: how many tables, which are heaps, how many nonclustered indexes each has, and how many rows each holds. The post tests it on a demo database and explains where the row count comes from.
SQL SERVER – Identify Numbers of Non Clustered Index on Tables for Entire Database
Here is a script that counts each non clustered index on tables across the entire database, and the small story of why I wrote it.
SARGable Date Filters: Stop Wrapping Columns in Functions
Write SARGable date filters as half-open ranges for years, months, days, and rolling windows, then compare plans and logical reads.
VECTOR_SEARCH in SQL Server 2025: Finding Similar Rows With a Vector Index
VECTOR_SEARCH returns the rows whose vectors sit closest to a vector you give it, and a vector index makes that search approximate and fast. This post builds a six-row test with hand-made numbers on SQL Server 2025, with no AI model, and lists the limits the test showed.
Unique Pairs in Either Order: Blocking A-B When B-A Exists
A plain unique index treats (1, 2) and (2, 1) as different rows. Two computed columns and one index fix that, and I test the awkward cases.
What Is a Primary Key, and What Happens Without One?
A primary key is the promise that every row can be told apart. Why NULL is refused, what a table without one actually costs you, how it differs from a unique constraint, and when to choose a natural key over a made up one.







