You can determine what version of OS you are running by looking at
Start > Programs > Accessories > System Tools > System Information
[Note: I am running windows server 2008 R2 & it works for me]
also, for sql server, this works for me select serverproperty('edition')