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 boat keel with boards aligned along it and another small group lying crosswise

Clustered Key Choice for Date Range Queries: Date or Identity

December 14, 2013
Pinal Dave
SQL Tips and Tricks
Clustered Index, SQL DateTime, SQL Identity, SQL Index

Should you cluster on OrderDate? Measure one month of orders on three designs and see what each one costs in reads before you rebuild a table.

Read More
A channel zester preserves one curled orange ribbon beside a heap of fine zest

Exporting CSV Files Without Losing Leading Zeros or Dates

December 11, 2013
Pinal Dave
SQL Tips and Tricks
CSV, Excel, SQL DateTime, Unicode

A postal code like 00501 turns into 501 in a spreadsheet. See where the zero is lost, how to build a correct CSV line, and why quotes alone do not help.

Read More
An open henhouse hatch with a simple linkage beside a closed plain shutter

Scheduling an Agent Job for Weekday Office Hours Only

December 7, 2013
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Monitoring, SQL Server Agent

Stop a monitoring job from waking anyone at 3 AM. Build the schedule, decode the weekday mask, and see what the window does not cover.

Read More
A driftwood beach comb beside an intact shell and a cracked shell of similar shape

Parsing File Name Dates to Find the Newest Backup With REGEXP_SUBSTR

November 13, 2013
Pinal Dave
SQL Tips and Tricks
SQL Backup and Restore, SQL DateTime, SQL String

A restore script that sorts names as text can grab a copy or a log file. Parse the dates first, drop the bad ones, and break ties on purpose.

Read More
A bulb planter beside separate clusters of shoots and empty planting hollows

Cohort Retention Tables in T-SQL: From Raw Events to a Grid

October 6, 2013
Pinal Dave
SQL Tips and Tricks
Business Intelligence, CTE, SQL DateTime, SQL Group By

Build a retention grid from raw orders with five rows you can check by eye. Includes the DISTINCT rule and why unfinished months show NULL.

Read More
Two hourglasses, one dropping coarse pebbles and one pouring fine sand, the fine one on a red base

GETDATE vs SYSDATETIME: Precision of the Current Time

June 20, 2013
Pinal Dave
SQL Tips and Tricks
SQL Datatype, SQL DateTime, SQL Function, SQL Server

Compare SYSDATETIME with GETDATE and UTC time functions, understand datetime rounding, and choose a clear timestamp type and clock contract.

Read More
Dark chocolate squares in an even grid on marble, one wrapped in red

Date Boundaries With DATETRUNC and EOMONTH in SQL Server 2022

May 18, 2013
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Server, SQL Server 2022

Use DATETRUNC and EOMONTH for month, quarter, and week boundaries in SQL Server 2022, including index-friendly half-open filters.

Read More
Previous 1 … 11 12 13 14 15 16 17 … 29 Next
  • Books
  • Testimonials
  • Privacy Policy

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