isnull and SELECT statements

  • If an entire SELECT statement is wrapped inside an isnull function, does this negate the use of any indexes that might otherwise be used?

  • I think it depends as the select statement should use it's where clause to get the data together. ISNULL is checking that the one value is null or not. As will only be a single value no index would be needed. I am assumeing you are speaking of something like this.

    IF ISNULL(SELECT [wife] FROM emp WHERE firstname = 'BOB' AND lastname = 'Hogan')

    In this case the select statement will use it's index.

    Are you referring to a specific way of using ISNULL other than this?

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)

  • No, that's it....you answered my question. Thanks

  • No, that's it....you answered my question. Thanks

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply