By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,696 Members | 2,213 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,696 IT Pros & Developers. It's quick & easy.

howto check the sql server edition from code

P: n/a
Hi,

I want to create a tool that run over Windows Server 2003 and checks
the sql server 2000 edition (Enterprise, Standard, Personal,
Developer).
I know I can do from the query analyzer - "Select @@version".
But how can I do it from code, is there a WMI API that can tell me
what's the edition?

Thanks,
Koby

Jul 23 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Why can't you issue SELECT @@VERSION from your code? It seems that
there is no registry entry that gives this information so AFAIK the
easiest way is to open a connection to the server and query the value
of @@VERSION or SERVERPROPERTY('Edition').

--
David Portas
SQL Server MVP
--

Jul 23 '05 #2

P: n/a
But how can I do it from code

What do you mean by it, FronEnd?

Madhivanan

Jul 23 '05 #3

P: n/a
TSQL: serverproperty('Edition')
SQLDMO: SQLServer2.VersionString
WMI: MSSQL_SQLServer.VersionString

The WMI provider documentation is on the CDROM, with the provider
itself, but you can just extract the wmisql.chm from the .cab file if
that's all you need.

Simon

Jul 23 '05 #4

P: n/a
Ray
I'm not a WMI programmer but you might look at the
Scripting.FileSystemObject object and use if it has anything for the product
version information. In Windows Explorer if you right click and get the
property information on the file MSSQL\Binn\sqlservr.exe click the version
tab and look at product information. This will give you the build number of
the exe.

Ray
"gokoby" <go****@gmail.com> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...
Hi,

I want to create a tool that run over Windows Server 2003 and checks
the sql server 2000 edition (Enterprise, Standard, Personal,
Developer).
I know I can do from the query analyzer - "Select @@version".
But how can I do it from code, is there a WMI API that can tell me
what's the edition?

Thanks,
Koby

Jul 23 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.