Wednesday, September 19, 2007

Tired

Another long day. Arrived 10:00. Left 11:00.

Spent a good portion of my evening trying to figure out how to determine what Edition of SQL Server 2000 is installed on a server. In newer versions, it's alot easier as there is just a registry key to check, but with the earlier versions of SQL Server, it is considerably more difficult. Found a scarcely documented call on MSDN though that might be worth trying.

Apparently you can get the Edition info by making an undocumented call to an export provided by sqlboot.dll

DWORD WINAPI QueryValue(DWORD dwSetting);
typedef DWORD (WINAPI *LPFNQUERYVALUE)(DWORD); // QueryValue function pointer

http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dnarsql7/html/deploybus_depdbsol.asp

Yes, I realize that I'm calling it undocumented but pointing to Microsoft's web site. Perhaps "completely unsupported and not in any official API documentation" would be a more appropriate characterization.

It is described a bit by a Microsoft developer in the SQL Server newsgroup too:

http://groups.google.com/group/microsoft.public.sqlserver.server/browse_thread/thread/f8bff873df9992a0/996e3e35e6483d5a?hl=en&lnk=st&q=sqlboot.dll&rnum=20#996e3e35e6483d5a

This whole thing wouldn't be an issue except you have to have the installation media in order to uninstall clustered instances. So I have to upload 500 MB worth of CD to the server in order to do an uinstall, and it has to be the media that matches whatever the edition I am trying to uninstall.

The whole matter makes me appreciate how much better the install works for SQL Server 2005, despite the issues I have run into there as well.