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
SQL SERVER - Removing Leading Zeros From Column in Table

SQL SERVER – Removing Leading Zeros From Column in Table

November 19, 2012
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts, SQL Server

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.

Read More
A line of falling wooden dominoes on a floor, with one red domino turned sideways to stop the chain.

Automating SQL Server Patching With PowerShell

November 18, 2012
Pinal Dave
SQL Tips and Tricks
Cumulative Update, PowerShell, SQL Patch, SQL Server, SQL Setup

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

Read More
A packed crate of film cans on a doorstep, the projector with its red strap left behind.

Restoring a TDE Protected Database on Another Server

November 17, 2012
Pinal Dave
SQL Tips and Tricks
SQL Backup and Restore, SQL Server, SQL Server Encryption, SQL Server Security

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

Read More
Two identical cottages side by side, one in midday sun and one at night

Storing UTC and Local Time Side by Side

November 13, 2012
Pinal Dave
SQL Tips and Tricks
SQL Datatype, SQL DateTime, SQL Function, SQL Server

Store UTC and local time consistently, preserve offsets, handle daylight saving changes, and filter timestamps with clear boundaries.

Read More
Darning mushroom supporting a sock with a small repaired patch

Change Logs as JSON: Old and New Values in One Column

November 12, 2012
Pinal Dave
SQL Tips and Tricks
JSON, SQL Scripts, SQL Server

Skip the audit table with a column for every field. One JSON payload per changed row is lighter, if you handle NULL and multirow updates correctly.

Read More
Grafting knife and prepared scion beside an older intact graft

Checking Certificates That Expire Soon in Every Database

November 8, 2012
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Server, SQL Server Security

Nobody remembers who created that certificate. Here is a short loop that lists every certificate expiring soon, and what to ask about each one.

Read More
Brewed tea being poured into a pitcher beside three infuser capsules

Window Functions Over GROUP BY Results: SUM of SUM Explained

November 7, 2012
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts, SQL Server

Why does SUM(SUM(Amount)) OVER () work? Because the window runs after GROUP BY. A short demo with shares, ranks and a filter trap.

Read More
Previous 1 … 286 287 288 289 290 291 292 … 420 Next
  • Books
  • Testimonials
  • Privacy Policy

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