Hi,
Is it possible ( preferably without SQL-DMO ) to get a version of the
SQL-server without really connecting to it ?
Thnx in advance,
Regards,
Sven Peeters
Belgium
Hi
The main SQL Server binary, SQLSERVR.EXE, contains the version information.
Get the version information from there.
Regards
Mike
"Sven Peeters" wrote:
> Hi,
> Is it possible ( preferably without SQL-DMO ) to get a version of the
> SQL-server without really connecting to it ?
> Thnx in advance,
> Regards,
> Sven Peeters
> Belgium
|||Sven,
Not via SQL-DMO. I tried to do it using the Registry object in DMO, but
you need to connect to it using the SQLServer.Connect method first, and
in any case it doesn't return the correct value. Here's my repro for
this failure:
'--
Dim oSrvr
Dim oReg
Set oSrvr = CreateObject ("SQLDMO.SQLServer2")
oSrvr.LoginSecure = True
oSrvr.Connect "myservernamehere"
Set oReg = oSrvr.Registry
WScript.Echo "Current version of SQL Server: " & oReg.SQLCurrentVersion
oSrvr.Disconnect
'--
I think the SQL-DMO API fails because it is looking here in the registry:
SOFTWARE\\Microsoft\\MSSQLServer\\MSSQLServer\\Cur rentVersion
Are you doing this programmatically? You can use a Registry class to
access the current version on the server.
This key should work for you for a default instance:
HKLM\\Software\\Microsoft\\MSSQLServer\\MSSQLServe r\\CurrentVersion\\CSDVersion
It will be different for a named instance.
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602m.html
Sven Peeters wrote:
> Hi,
> Is it possible ( preferably without SQL-DMO ) to get a version of the
> SQL-server without really connecting to it ?
> Thnx in advance,
> Regards,
> Sven Peeters
> Belgium
Wednesday, March 21, 2012
Retrieving SQL Server Version without connecting
Labels:
advance,
connecting,
database,
microsoft,
mysql,
oracle,
preferably,
regards,
retrieving,
server,
sql,
sql-dmo,
sven,
thesql-server,
thnx,
version
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment