In MSSQL What is ISNULL() function? how do we use it?

 Posted by Tripati_tutu on 4/30/2011 | Category: Sql Server Interview questions | Views: 5413 | Points: 40

ISNULL() function is used to check the value is null or not in SQL Server. This
function also provides a way to replace a value with the null if the result is true.

Here @Param is a nullable parameter and isnull checks the parameter is a null value
or not. If it is a null, it replaces it with '' string.
ISNULL(@Param, '')

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Posted by: PandianS on: 5/2/2011 | Points: 10

The following is an alternate for ISNULL
Select Case When @Param Is Null Then '' Else @Param End


Login to post response