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
Nov21

Display Datetime in a Specific Format: CONVERT and FORMAT

Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts, SQL String
12 Comments

To display datetime in a specific format, use CONVERT with a style number or FORMAT with a pattern. This post tests both on a fixed value, shows the lowercase pattern mistake, measures how much slower FORMAT is, and explains why parsing text dates needs a style.

Continue Reading
Nov20

SQL SERVER – Using RAND() in User Defined Functions (UDF)

Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts, SQL Server
17 Comments

Using RAND() in a user defined function throws Msg 443, invalid use of a side-effecting operator. Here is a simple workaround that lets a UDF use a random value.

Continue Reading
Nov19

SQL SERVER – Removing Leading Zeros From Column in Table

Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts, SQL Server
37 Comments

Most people ask how to keep leading zeros in SQL Server. This time a reader wanted to remove leading zeros and white space from a column, so here is a script.

Continue Reading
Nov18

Automating SQL Server Patching With PowerShell

Pinal Dave
SQL Tips and Tricks
Cumulative Update, PowerShell, SQL Patch, SQL Server, SQL Setup
1 Comment

Automating SQL Server Patching with PowerShell means staging a verified package, running Setup quietly, checking logs, and stopping on failure.

Continue Reading
Nov17

Restoring a TDE Protected Database on Another Server

Pinal Dave
SQL Tips and Tricks
SQL Backup and Restore, SQL Server, SQL Server Encryption, SQL Server Security
1 Comment

Restore a TDE protected database on another SQL Server by moving its certificate and private key, then verify encryption state.

Continue Reading
Nov16

SQL SERVER – Retrieving Random Rows from Table Using NEWID()

Pinal Dave
SQL Tips and Tricks
SQL Function
24 Comments

Two quick ways to pull random rows from table data in SQL Server: ORDER BY NEWID() or CHECKSUM(NEWID()) with TOP, plus a 60 second video.

Continue Reading
Nov15

SQL SERVER – Concurrency Basics – Guest Post by Vinod Kumar

Pinal Dave
SQL Performance
8 Comments

Vinod Kumar explains concurrency basics with a simple queue analogy: the shorter the line, the higher the concurrency, and how databases manage it with locks.

Continue Reading
Previous 1 … 513 514 515 516 517 518 519 … 847 Next

SQL Server slow? Let's fix it together in about four hours.

Pinal Dave

In my Comprehensive Database Performance Health Check, you share your screen, I guide you, and we fix your biggest performance troublemakers. No passwords. No remote access.

You keep every script, and the know-how to fix it yourself next time.

Want your whole team to learn it?

My Practical Workshop has no PowerPoint, just live demos. My AI Enablement Workshop shows your team where AI saves hours, and where it quietly costs them.

Over 400 customers have worked with me this way, and not one shared a password. See all consulting options.


Who We Are

Pinal Dave is an SQL Server Performance Tuning Expert and independent consultant with over 24 years of hands-on experience. He holds a Masters of Science degree and numerous database certifications.

Pinal has authored 19 books and 125 Pluralsight courses. To freely share his knowledge and help others build their expertise, Pinal has also written more than 5,800 database tech articles on his blog at https://blog.sqlauthority.com.

Pinal is also a CrossFit Level 1 Trainer (CF-L1) and CrossFit Level 2 Trainer (CF-L2).


Nupur Dave is a social media enthusiast and an independent consultant. She primarily focuses on the database domain, helping clients build short and long-term multi-channel campaigns to drive leads for their sales pipeline.


Shaivi Pinalkumar Dave is a book author and a women’s artistic gymnast.

  • Books
  • Testimonials
  • Privacy Policy

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