Jeff Moden

  • Interests: SQL. When Im not having fun with that, then SQL. ;-)

Technical Article

Create a Tally Function (fnTally)

Many people have published high performance, read-less, Inline Table Valued functions that use Itzik Ben-Gan's wonderful "Virtual Numbers Table" to replace WHILE loops and other forms of RBAR. This one is Jeff Moden's version.

4.86 (7)

You rated this post out of 5. Change rating

2019-08-13 (first published: )

6,030 reads

Technical Article

Difference between dates with thousands separators

This function calculates the time difference between 2 datetimes and displays the results in the following format:H,HHH,HHH:MM:SSThe return is a 15 character field that is left padded with spaces so that the field becomes right justified.  This makes the colons line up for easy reading.  Commas are automatically added as thousands separators as needed by […]

3 (2)

You rated this post out of 5. Change rating

2004-03-14

406 reads

Blogs

Migrate datetime data to datetimeoffset with AT TIME ZONE

By

I recently reviewed, worked on, and added a similar example to the DATETIMEOFFSET Microsoft...

The Comprehensive Guide to Mastering Your SQL DBA Skills

By

Database administrators (DBAs) are the backbone of data-driven organizations. If you're looking to break...

Friday Basics: Authentication vs. Authorization

By

Another security fundamentals topic is authentication versus authorization. For those who have a clear...

Read the latest Blogs

Forums

The OS returned the error '(null)' while attempting 'DeleteFile' filestream.hdr

By lmarkum

I have a SQL Server 2019 Enterprise Edition on CU 25. It has in-memory...

Take Care

By Grant Fritchey

Comments posted to this topic are about the item Take Care

Performance

By LearningDBA

Experts, I am learning some skills so I can troubleshoot some performance-related issues. I...

Visit the forum

Question of the Day

Two Table Hints

What happens when I run this code:

SELECT
  p.ProductName
, p.ProductCategory
FROM dbo.Product AS p WITH (NOLOCK, TABLOCK);

See possible answers