top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is the difference between "IS NULL" and "ISNULL" in SQL Server??

+2 votes
647 views
What is the difference between "IS NULL" and "ISNULL" in SQL Server??
posted Oct 7, 2013 by Jonathan Little

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

+1 vote

IS NULL is used to check whether a value is null or not.

Ex: if @parametername is null then
        go here

ISNULL works like a method by using which you can use null values as your requirement.

Ex: select ISNULL(table.name,'No Name Specified'),
in this example if name is null then it will replace it with no name specified.
answer Oct 7, 2013 by Atul Mishra
0 votes

ISNULL is used where we want to replace any value based on that it's value is null or not

select ISNULL(NULL, 1) - Result 1
select ISNULL(2, 1) - Result 2

While IS NULL is used to select records from a table where particular column is null Ex-

Select * from products where
product_code is null

answer Nov 14, 2013 by Neeraj Pandey
Similar Questions
+2 votes

I have two tables to join with a column (say emp_id).. if emp_id in both the tables have null values, how will SQL Server and Oracle treat???

I read that informatica will neglect the NULL rows when joining..if I handle the null, by substituting -1, a cross-join will happen which i don't want..

What can I do here? (I cannot completely neglect the rows which has NULL)

...