fire up query analyzer, attempt to connect to the machine (assuming you have a valid account or username/password). If you can connect, run SELECT @@Version to determine the version number of SQL that you are running.
Alternatively, look in Program Files/Microsoft SQL Server. You should see two folders: \Bin and \80 (at least 80 is what you will see for a SQL 2000 installation.
wouldn't checking the program files/micrsoft sql server folder be not reliable, since everyone can installed it in a different location. I would like to be able to check if sql server is intalled from code, before i query something from osql for example.