All OS version in one function

  • Wilfred van Dijk

    SSCrazy Eights

    Points: 8969

    Comments posted to this topic are about the item All OS version in one function

    Wilfred
    The best things in life are the simple things

  • lcarpay

    SSC Veteran

    Points: 271

    Hi Wilfred, there is a small typo in the code; in the select ... full_windows_name from ... cte one quote ( ' ) is used instead of two ( ' ' ).

    cheers Leon

  • chudman

    SSCrazy

    Points: 2422

    Very nice script. As noted in the above post, the last few lines should read:

    then windows_server_release_name + rtrim(' ' + windows_service_pack_level) + ' ' + case when left(windows_server_release_name, len(windows_product_type)) <> windows_product_type then windows_product_type else ' ' end

    else windows_home_release_name + rtrim(' ' + windows_service_pack_level) + ' ' + case when left(windows_home_release_name, len(windows_product_type)) <> windows_product_type then windows_product_type else ' ' end

    end as full_windows_name

    from CTE

    )

    go

    Thanks again, this will be very useful.

    Jeff Bennett

    St. Louis, MO, USA

  • Wilfred van Dijk

    SSCrazy Eights

    Points: 8969

    I already noticed the missing quote and fixed the code. However, the SQLServerCentral team first reviews every change before it's published so there's a slight delay before it's available. The correct version should be available now for download.

    Wilfred
    The best things in life are the simple things

  • Wilfred van Dijk

    SSCrazy Eights

    Points: 8969

    NOTE: This function works with SQL2008R2 SP1 and upwards. So if you're still having an RTM version, it's time to update! :hehe:

    Wilfred
    The best things in life are the simple things

Viewing 5 posts - 1 through 5 (of 5 total)

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