Jonathan Roberts


Technical Article

User-Created GENERATE_SERIES() Function for Older SQL Server Versions

In the world of SQL Server, adaptation is key. While the built-in GENERATE_SERIES() function was a valuable addition in SQL Server 2022, its absence in older versions created a functionality gap. Enter the user-written GENERATE_SERIES function. Adapted from Jeff Moden's "dbo.fnTally", it offers an efficient means to generate a series of numbers within a defined range in older SQL Server versions. Its design mirrors the built-in function in SQL Server 2022, making the transition between versions as simple as removing the dbo. prefix. This forward-thinking design reflects the ingenuity of the SQL Server community, ensuring a seamless, efficient database migration experience.

You rated this post out of 5. Change rating

2023-06-26 (first published: )

896 reads

Technical Article

A DateRange Table Valued function

The function is an inline table-valued function (or sometimes called a parameterised view) so it can be used just like a view or a table but needs parameters. It generates a single-column table of datetime2 with rows differing by any multiple of any of the dateparts that SQL Server provides.

5 (6)

You rated this post out of 5. Change rating

2019-08-29 (first published: )

4,739 reads

Blogs

Announcements from the Microsoft Fabric Community Conference

By

(Shameless plug: The price of my book “Deciphering Data Architectures: Choosing Between a Modern...

The Basics of TRY CATCH Blocks–#SQLNewBlogger

By

I was working with a customer and discussing how to do error handling. This...

Working with ALS – Insights from the Ability Summit

By

The 14th annual Ability Summit is a global event that I attended a few...

Read the latest Blogs

Forums

The Journey to Change

By Steve Jones - SSC Editor

Comments posted to this topic are about the item The Journey to Change

Check Azure SQL DB Space Used

By Cláudio Silva

Comments posted to this topic are about the item Check Azure SQL DB Space...

The Cloned Database Size

By Steve Jones - SSC Editor

Comments posted to this topic are about the item The Cloned Database Size

Visit the forum

Question of the Day

The Cloned Database Size

I have a small test sandbox database on an instance with default master, model, msdb, and tempdb settings. The database has these files:database file propertiesI now run this command:

DBCC CLONEDATABASE(sandbox, sandbox_clone);
GO
When I examine the database file properties, what do they show?

See possible answers