What is the output of below sql query?

declare @str varchar(10);
set @str = 'Hello';
select ISNULL(@str,'Hello World');

 Posted by vishalneeraj-24503 on 12/30/2013 | Category: Function Points (FPA) Interview questions | Views: 1097 | Points: 40
Answer:

Output would be Hello.

As IsNull checks 1st arguments,if the first argument value is null then returns second argument values.

In above query, @str is assigned a Hello,so ISNull will omit the second parameter value and return 1st parameter value that is Hello.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response