To get alternate row colors in an HTML table from T-SQL, number the rows with ROW_NUMBER and pick a color by odd or even. This post builds the whole table with STRING_AGG, escapes special characters, colors one cell by value, and explains why the numbering must follow the display order.
How to Find Service Account for SQL Server and SQL Server Agent? – Interview Question of the Week #179
How do you find the Service Account for SQL Server and SQL Server Agent? Here are three ways: Configuration Manager, services.msc, and a T-SQL query.
Tally Table: Replacing WHILE Loops With a Set of Numbers
Use a tally table or GENERATE_SERIES to replace repeated date, character, and missing-number loops with ordered sets of rows.
How Much Work Each Processor (CPU) is Doing in SQL Server? – Interview Question of the Week #178
A client with 56 processors saw CPU always high and wanted to know how busy each one was. Here is a simple DMV query that shows work per Processor (CPU).
SQL SERVER – Adding Values WITH OVER and PARTITION BY
How do you sum values for each group without GROUP BY and still keep every row? Here is how SUM with OVER and PARTITION BY answers a reader’s question.
SQL SERVER – How to DELETE Multiple Table Together Via SQL Server Management Studio (SSMS)?
A DBA asked for a shortcut to drop more than one table at once in SSMS without writing T-SQL. Here are the simple steps, using just the keyboard.






