The Subtle Differences Between COALESCE and ISNULL
See how ISNULL and COALESCE behave in different situations and ensure you know which one to pick when.
2025-04-18
4,941 reads
See how ISNULL and COALESCE behave in different situations and ensure you know which one to pick when.
2025-04-18
4,941 reads
2025-04-02
1,947 reads
One of the lesser used functions is COALESCE(), used to allow you to return one value from a list of those that are potentially NULL. This short pieces gives a few examples where this is useful?
2021-08-16
4,278 reads
2018-05-18
974 reads
2016-01-29
1,682 reads
Sandeep Mittal provides an introduction to the COALESCE function and shows how to use it.
2015-11-25
4,572 reads
2013-09-20
2,711 reads
2013-06-03
2,605 reads
2012-11-09
2,210 reads
2012-10-17
2,505 reads
You can find the slides of my session on the €100 DWH in Azure...
By Steve Jones
This value is something that I still hear today: our best work is done...
By gbargsley
Have you ever received the dreaded error from SQL Server that the TempDB log...
Hi everyone I am writing an SP where there is logic inside the SP...
Comments posted to this topic are about the item Planning for tomorrow, today -...
We have a BI-application that connects to input tables on a SQL Server 2022...
I try to run this code on SQL Server 2022. All the objects exist in the database.
CREATE OR ALTER VIEW OrderShipping AS SELECT cl.CityNameID, cl.CityName, o.OrderID, o.Customer, o.OrderDate, o.CustomerID, o.cityId FROM dbo.CityList AS cl INNER JOIN dbo.[Order] AS o ON o.cityId = cl.CityNameID GO CREATE OR ALTER FUNCTION GetShipCityForOrder ( @OrderID INT ) RETURNS VARCHAR(50) WITH SCHEMABINDING AS BEGIN DECLARE @city VARCHAR(50); SELECT @city = os.CityName FROM dbo.OrderShipping AS os WHERE os.OrderID = @OrderID; RETURN @city; END; goWhat is the result? See possible answers