I am trying to write a program in Java which has to check if SQL Server (2008) is installed on a particular machine. Is checking the registry entry the only solution? I prefer a file-based solution.
Currently, I am checking for the presence of OSQL.exe (which I use to execute queries and SQL scripts) in the <Installation Path>\100\Tools\Binn folder. What does the 100 specify? Can it be hardcoded in the program, or will I have to search for the OSQL.exe file starting from the installation path?
100is the version of SQL server, and specifically means you're dealing with a2008or2008 R2installation (Internally, 2008 is version 10.0, but they remove the "." in the path).2005installed primarily under a90directory,2000under80, etc.