Consider the fowling structure:
CREATE TABLE [tblEntityLogs]
(
[EntityLogId] [int] IDENTITY(1,1) NOT NULL,
[EntityCountCurrent] [float] NOT NULL,
...
)
When executing the query underneath I get an empty row returned…
DECLARE @N FLOAT
SET @N = 666
SELECT ISNULL(tblEntityLogs.EntityCountCurrent, @N) AS EntityCountCurrent
FROM tblEntityLogs
And if I do:
SELECT tblEntityLogs.EntityCountCurrent FROM tblEntityLogs
The same thing happens. I don’t even get NULL back.
Note: The table is empty.
If the table is empty then you won’t get anything back – it’s by design.
Although, I don’t why you’d use/test it with IsNull as your table structure doesn’t allow Nulls.