Questions about Alias and ISNULL

  • Hi, i was read that when i use alias for a query is a bad practices, but i think that is incorrect because the query optimizer use alias for identify a tables in a query or subquery. So, what is the best practice about alias?

    On the other hand, i have a problem with ISNULL() function in SQL Server 2000 Standar version without SP. Sometimes the not work, so i need use the CASE with IS NULL operator.

    Thanks for the responses.

    Deusdit Correa Cornejo

    ----------------------

    Br. Computer Science

    Microsoft Certified Database Administrator

    Analyst Programmer

    ----------------------


    Deusdit Correa Cornejo
    ----------------------
    Br. Computer Science
    Microsoft Certified Database Administrator
    Analyst Programmer
    ----------------------

  • I have never read anything on this and use alias quite often, expecially for long table names and data structures that don't make normal sense with their current names. It is possible that peek performance is reached with the real name as opposed to the alias when the compiler is working as it needs to make memory references or pointers to id the alias' real object but I have never run into any noticeable difference in a query.

    What is happening with ISNULL() and what exatcly did your code originally look like.

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

  • I use aliases for table names a lot too - even if shown a performance hit it would have to be pretty bad to get me to change!

    Andy

  • Don't think it affects performance. Likely the parser handles this, so the query engine will not even see it.

    I ALWAYS use aliases.

    Steve Jones

    steve@dkranch.net

  • So Steve Jones isn't really your name? Reveal your secret identity!

    Andy

  • Andy,

    I am your father.

    Steve Jones

    steve@dkranch.net

  • I saw the movie, isn't the line

    Loke, I am your..........MOTHER. (Thumbs Wars, much better than the original)

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

  • Thanks for the response, because these confirmed my opinion about the alias.

    About ISNULL() function, this not function sometimes because in a NULL column not detect this value. I think that is error should be correct in some Service Pack.

    Ah!, the jokey are god, but they do not exaggerate 😀

    Deusdit Correa Cornejo

    ----------------------

    Br. Computer Science

    Microsoft Certified Database Administrator

    Analyst Programmer

    ----------------------


    Deusdit Correa Cornejo
    ----------------------
    Br. Computer Science
    Microsoft Certified Database Administrator
    Analyst Programmer
    ----------------------

  • Well that explains a few things. Actually "I" am Steve Jones, I just like to argue between my two split personalties.

    Andy

Viewing 9 posts - 1 through 8 (of 8 total)

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