wpfwannabe
wpfwannabe

Reputation: 14877

How to check whether SQL Server 2005 or 2008 is installed

I am looking for ways of programmatically checking whether SQL Server 2005 or 2008 is installed on a particular machine.

With some MS packages it is as easy as checking Install values in registry on a certain path. For instance to check for Full NET 4 one would need to look at HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full.

Is there a similar thing for SQL Server? I am looking for the real thing, not the "Express". How can I make a distinction? Also, any individual check for 2005, 2008 or R2 or a cumulative check is fine.

Additionally, I am not restricting myself to registry. If the check includes file system search, that is perfectly fine too.

I have found a few answers like this and this but they do not fill my cup entirely.

Upvotes: 0

Views: 1186

Answers (1)

Stu
Stu

Reputation: 15779

The only supported way to figure out the edition is to connect to it and execute

Select ServerProperty('Edition')

Upvotes: 5

Related Questions