How to Use the New PRODUCT() Function in SQL Server 2025


 

With each version of SQL Server, there are always a few new features introduced that we applaud as we finally have access to a useful function that is already available elsewhere.

Introduced in SQL Server 2025 CTP 1.3, the PRODUCT() function acts similarly to SUM(), but multiplies values rather than adds them. It is an aggregate function in SQL Server and therefore operates on a data set, rather than on scalar values.

Calculating a Product Without PRODUCT()

Prior to the existence of this function, writing T-SQL to multiply a series of set-based values was possible, though not exactly pretty. Consider