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
Two wooden metronomes side by side on a shelf, their pendulums swinging at different tempos

Scheduling Recurring Events: Every Second Tuesday in T-SQL

February 12, 2019
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts, SQL Server

Generate recurring events with stable weekday arithmetic, monthly ranking, and anchored fourteen-day rules instead of endless date rows.

Read More
Find out current language of the session.

SQL SERVER – Find Out Current Language of the Session

February 8, 2019
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts, SQL Server

How do you find the current language setting of your session? A reader asked me, and @@LANGID with sys.syslanguages gives the answer in one short query.

Read More
Parked cars along a curb seen from above with gaps between them, one wide enough for a car, one too short

Finding Free Time Slots in a Calendar With GENERATE_SERIES

January 12, 2019
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Server, SQL Server 2022

Find free time slots with GENERATE_SERIES, exclude overlapping bookings, and merge busy intervals before calculating calendar gaps.

Read More
50 Length shown in Varchar.

SQL SERVER – Measuring the Length of VARCHAR and NVARCHAR Columns with COL_LENGTH

December 29, 2018
Pinal Dave
SQL Tips and Tricks
SQL Column, SQL Datatype, SQL Function, SQL Scripts, SQL Server

Does an NVARCHAR column take twice the space of VARCHAR? Yes. I measure the length of VARCHAR and NVARCHAR columns with COL_LENGTH to show it.

Read More
A laden plum tree with a tiny bowl at its foot and a large red crate beside it.

Multi-Statement Table-Valued Functions and Interleaved Execution

November 21, 2018
Pinal Dave
SQL Performance
Execution Plan, SQL Function, SQL Performance, SQL Server 2017

See how interleaved execution corrects estimates for multi-statement table-valued functions and when an inline rewrite wins.

Read More
12:00 digital clock.

How to Trim TIME Part in DATETIME Values? – Interview Question of the Week #200

November 18, 2018
Pinal Dave
SQL Interview Questions and Answers
SQL DateTime, SQL Function, SQL Server, SQL String

How to trim TIME part in DATETIME values? A reader wanted to keep only the date and the hour, so here are ways to cut off the minutes and seconds.

Read More
An icon set with time, calendars and checkmarks.

SQL Server – Formatted Date and Alias Name in ORDER BY Clause

September 28, 2018
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Order By, SQL Scripts, SQL Server

Format a date with CONVERT, then use its alias in ORDER BY, and the rows come back in a different order. Here is a simple example of this formatted date surprise.

Read More
Previous 1 … 9 10 11 12 13 14 15 … 63 Next
  • Books
  • Testimonials
  • Privacy Policy

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