• yogyogi97 (4/15/2013)

    COUNT(convert(int,NULL)) - It will give count as 0 always. Don't know why it is giving 0 count however COUNT() function counts NULL values also.

    Please go through below select statement. Here we are try to convert "Varchar" and "int" into "NULL".

    And as per as your Explanation. Count () function counts only non-NULL values. That's why its give output as "0".

    I think so. If anyone have some other aspect, please let us know. 🙂

    select CONVERT(INT, NULL), COUNT (CONVERT(INT, NULL)), CONVERT(VARCHAR(111), NULL), COUNT (CONVERT(VARCHAR(111), NULL))

    Thanks for question 🙂

    Thanks
    Vinay Kumar
    -----------------------------------------------------------------
    Keep Learning - Keep Growing !!!