This month's discount Comprehensive Database Performance Health Check · Testimonials
SQLAuthority with Pinal Dave
Home
  • Consulting
    • Health Check
  • Free Videos
  • All Articles
    • AI
    • SQL Performance
    • SQL Tips and Tricks
    • Interview Questions and Answers
    • SQL Puzzle
    • SQL Video
    • SQLAuthority News
    • Personal
  • Books
  • Consulting
Gouache painting of a row of deck chairs alternating cream and slate blue with one vermilion chair

Alternate Row Colors in an HTML Table Using T-SQL

June 25, 2018
Pinal Dave
SQL Tips and Tricks
HTML, SQL Scripts, SQL Server

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.

Read More
Different service keys and blank colored fobs hang above separate locks

How to Find Service Account for SQL Server and SQL Server Agent? – Interview Question of the Week #179

June 24, 2018
Pinal Dave
SQL Interview Questions and Answers
SQL Log, SQL Scripts, SQL Server, SQL Server Security, SQL Server Services

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.

Read More
Milk pouring into a whole row of glass bottles at once from a bar of spouts in a dairy

Tally Table: Replacing WHILE Loops With a Set of Numbers

June 22, 2018
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Server, SQL Server 2022, SQL String

Use a tally table or GENERATE_SERIES to replace repeated date, character, and missing-number loops with ordered sets of rows.

Read More
Errmsg about logins created with password.

SQL SERVER – Transfer Logins Error: Msg 15419: Supplied Parameter sid Should be Binary(16) – sp_help_revlogin

June 21, 2018
Pinal Dave
SQL Tips and Tricks
SQL Error Messages, SQL Login, SQL Scripts, SQL Server, SQL Server Security

Moving logins with sp_help_revlogin, I hit Msg 15419: supplied parameter sid should be binary(16). Here is what causes it and how to fix the script.

Read More
Loom stations have different amounts of waiting work in their baskets

How Much Work Each Processor (CPU) is Doing in SQL Server? – Interview Question of the Week #178

June 17, 2018
Pinal Dave
SQL Interview Questions and Answers
SQL CPU, SQL DMV, SQL Scripts, SQL Server

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).

Read More
Over and partion by query results.

SQL SERVER – Adding Values WITH OVER and PARTITION BY

June 16, 2018
Pinal Dave
SQL Tips and Tricks
Ranking Functions, SQL Function, SQL Order By, SQL Scripts, SQL Server

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.

Read More
SQL SERVER - How to DELETE Multiple Table Together Via SQL Server Management Studio (SSMS)?

SQL SERVER – How to DELETE Multiple Table Together Via SQL Server Management Studio (SSMS)?

June 14, 2018
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Server, SQL Server Management Studio

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.

Read More
Previous 1 … 97 98 99 100 101 102 103 … 365 Next
  • Books
  • Testimonials
  • Privacy Policy

© 2006 – 2026 All rights reserved. pinal @ SQLAuthority.com