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
A strip of stitched buttonholes shows distinct gaps between successive openings in cream cloth

Measuring Time Between Workflow Steps With LEAD

August 15, 2012
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Order By, SQL Reports

Status rows hold timestamps, not durations. I use LEAD to measure each step, keep unfinished steps NULL, and show why zero ruins your averages.

Read More
A bicycle wheel leans on a wall with one bent spoke, while loose spokes and a spoke key lie on the floor

Comparing Session SET Options Between SSMS and the Application

August 6, 2012
Pinal Dave
SQL Performance
SQL Cache, SQL Connection, SQL DateTime, SQL Server Management Studio

Fast in SSMS, slow in the app? The query may be fine and the connection settings different. Here is how to check, with nothing to set up.

Read More
A narrow fabric tape stretches between two fixed clips with cloth extending outside both ends

Time-Limited Access: Expiring Grants With a Valid-Until Column

July 21, 2012
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL DateTime, SQL Server Security, SQL View

A ValidUntil column does nothing by itself. Here is how to make the read path enforce it, with a demo you can run.

Read More
Two shoes sit immediately on opposite sides of a narrow doorway threshold strip

DATEDIFF Counts Boundaries, Not Time: Getting Durations Right

July 10, 2012
Pinal Dave
SQL Tips and Tricks
Mathematics, SQL DateTime, SQL Function, SQL NULL

A report can say one year of service after a single day. Here is why DATEDIFF does that, and what to use instead.

Read More
SQL SERVER - SmallDateTime and Precision - A Continuous Confusion

SQL SERVER – SmallDateTime and Precision – A Continuous Confusion

May 22, 2012
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Scripts, SQL Training

SmallDateTime and precision confuse a lot of people. I explain what the precision really is, using a Facebook question from Raghavendra.

Read More
Highlighted datetime2 value.

SQL SERVER – Saturday Fun Puzzle with SQL Server DATETIME2 and CAST

May 19, 2012
Pinal Dave
SQL Puzzle
SQL DateTime

A Saturday fun puzzle with DATETIME2 and CAST in SQL Server 2012. Run each script one at a time, guess the output, and learn something new.

Read More
A very long striped knitted scarf trailing from an armchair across the floor, needles still in the last row

Storing Durations and Summing Time Past 24 Hours

April 12, 2012
Pinal Dave
SQL Tips and Tricks
SQL Datatype, SQL DateTime, SQL Function, SQL Server

Use whole seconds for summing time beyond 24 hours, aggregate safely, format unlimited hours, and convert legacy time values.

Read More
Previous 1 … 14 15 16 17 18 19 20 … 29 Next
  • Books
  • Testimonials
  • Privacy Policy

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