Wednesday, March 7, 2012

Registry information

All,
If I wanted to establish the versions of a SQL Server installs
programatically throughout my domain, what in your opinion would be the best
method WITHOUT connecting to SQL. I can connect to each machine without
issue, but I need to now gather the information on SQL.
I've been looking at registry keys, but am not confident this can provide
the information I need. Can anybody please advise?
Many Thanks
Adam
--
Adam J WarneYou can get the version info from registry. But it's messy, probably not
supported, and changes from version to version. If all possible, I'd try to
get the version info from within the SQL instance usign the SERVERPROPERTY
function. (I'd reason that if you can access registry directly, you probably
should be able to get a login to access the SQL instances for their verison
info. But then having the login for the SQL instances is a different
practical story.)
Having said that, if you really want to get the version info from registry
for SQL2000, you may find it here (No guarantee and you need to verify it
yourself):
1. Get the installed instances from HKLM\Software\Microsoft\Microsoft SQL
Server\InstalledInstances
2. Loop through the registry entries for the installed named instances to
get their versions
HKLM\Software\Microsoft\Microsoft SQL
Server\<InstanceName>\MSSQLServer\CurrentVersion\CSDVersion
For SQL2005, look in:
HKLM\Software\Microsoft\Microsoft SQL
Server\MSSQL.<#>\MSSQLServer\CurrentVersion\CurrentVersion
Again, it's better not to directly lookup registry for the SQL verison info.
Linchi
"Adam Warne" wrote:
> All,
> If I wanted to establish the versions of a SQL Server installs
> programatically throughout my domain, what in your opinion would be the best
> method WITHOUT connecting to SQL. I can connect to each machine without
> issue, but I need to now gather the information on SQL.
> I've been looking at registry keys, but am not confident this can provide
> the information I need. Can anybody please advise?
> Many Thanks
> Adam
> --
> Adam J Warne

No comments:

Post a Comment