What is the output of below sql query?

declare @str varchar(50);
select ISNULL(@str,'Hello World');

 Posted by vishalneeraj-24503 on 12/30/2013 | Category: Sql Server Interview questions | Views: 2816 | Points: 40
Answer:

Output would be Hello World.

As IsNull checks 1st arguments,if it's null then returns second argument values.

And in above query @str has no value means @str has not been assigned any value.

so it will return 2nd argument value that is Hello World


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response