SQL Version (Build) with WMI

Hello ng

How can I get the SQL-Server Version and Edition with WMI or registrykey?
This server is patched with SP3 and CU5. The BuildNumber is 10.0.2746.0 now.

This RegistryKey give only the basic insallation version, not with updates.
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\100\BIDS\Setup]
"Version"="10.0.1600.22"

With this SELECT I can list what I want, but I search a WMI querie.
SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('edition')
10.0.2746.0
Enterprise Edition (64-bit)

thanks for your help
Mick

0
Mick
2/5/2010 10:01:26 AM
scripting.vbscript 564 articles. 0 followers. Follow

2 Replies
1532 Views

Similar Articles

[PageSpeed] 11

"Mick" <mw@jansen.com> wrote in message 
news:217D870A-C5F8-4C2A-A076-EBBD58E38B04@microsoft.com...
> Hello ng
>
> How can I get the SQL-Server Version and Edition with WMI or registrykey?
> This server is patched with SP3 and CU5. The BuildNumber is 10.0.2746.0 
> now.
>
> This RegistryKey give only the basic insallation version, not with 
> updates.
> [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL 
> Server\100\BIDS\Setup]
> "Version"="10.0.1600.22"
>
> With this SELECT I can list what I want, but I search a WMI querie.
> SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('edition')
> 10.0.2746.0
> Enterprise Edition (64-bit)
>
> thanks for your help
> Mick
>

I would use the T-SQL @@VERSION function in a query to get the SQL Version. 
I use ADO in a VBScript program to run SQL statements, but you can also use 
query analyzer or isql or a similar utility. The T-SQL statement is:

SELECT @@VERSION AS Version

A VBScript solution could be:
=============
' SQLVersion.vbs
' VBScript program to query SQL Server version.

Option Explicit

Dim strConnect, adoConnection, adoRecordset, strVersion

strConnect = "DRIVER={SQL Server};" _
    & "Trusted_Connection=Yes;" _
    & "DATABASE=MyDatabase;" _
    & "SERVER=MyServer\MyInstance"

Set adoConnection = CreateObject("ADODB.Connection")
adoConnection.ConnectionString = strConnect
adoConnection.Open

Set adoRecordset = CreateObject("ADODB.Recordset")
Set adoRecordset.ActiveConnection = adoConnection

adoRecordset.Source = "SELECT @@VERSION AS Version"

adoRecordset.Open

Do Until adoRecordset.EOF
    strVersion = adoRecordset.Fields("Version").Value
    Wscript.Echo strVersion
    adoRecordset.MoveNext
Loop

' Clean up.
adoRecordset.Close
adoConnection.Close
========
My connection string assumes a named instance and Windows Integrated 
Authentication.

-- 
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
-- 


0
Richard
2/5/2010 6:55:19 PM
"Richard Mueller [MVP]" <rlmueller-nospam@ameritech.nospam.net> schrieb im 
Newsbeitrag

Hello Richard

Exactly I looked for that!
Thanks a lot.

Greets from Switzerland.
Mick 

0
Mick
2/8/2010 9:08:55 AM
Reply:

Similar Artilces:

POP module now extremely slow on version 9.0
We have very slow performance on PA purchase orders in version 8 and after multiple support incidences, we basically just had to live with it. Luckily only 1 of our 15 companies used PA and only a few POs a week were done. Now, we go to version 9, which PA and regular POP are now merged. We now have the very slow performance we saw in PA, in regular POP and for ALL of our companies. Even the message about PA vendor info missing keeps popping up for companies that don't even use PA. We have to tell our users to just clicking No on the error and keep going. The slowness is felt m...

Calling Dex Procedures from SQL
Is there any way to call dex procs from SQL or VB code? Jed There is an undocumented and unsupported method of calling Dex code from VBA. However, I know of no method of calling Dexterity from SQL. Please email me if you want an example, just remove the online. from the address below. David Musgrave [MSFT] Senior Development Consultant MBS Services - Asia Pacific Microsoft Business Solutions http://www.microsoft.com/BusinessSolutions mailto:dmusgrav@online.microsoft.com Any views contained within are my personal views and not necessarily Microsoft Business Solutions policy. This p...

is SQL 2000 architecture different SQL Server 2005 / 2008 architecture?
Hi I have a book "inside SQL Server 2000" by Kalen Delaney, which I have been told is a good book. I am going backwards... reading about the sql server architecture in chapter 3 of the book. As I'm reading... I was wondering is it different SQL Server 2000 vs SQL Server 2005/2008? Also where can I find a book/or link that can give me more details about the internals on architecture? Thank you norm (normanchan@gmail.com) writes: > Hi I have a book "inside SQL Server 2000" by Kalen Delaney, which I > have been told is a good book. I am g...

Moving customizations from SQL 2k to SQL 2k5 CRM
This may be a non-issue but I wanted to check to see if anyone has done this and ran into issues. I have the XML customization files from our previous install of CRM 3.0 with SQL 2k database. I now want to import and publish these same customizations to CRM 3.0 on SQL 2k5. Has anyone done this or can point me to documentation that tells about the success or issues for doing this? Thanks. On 7 Feb., 06:35, Chris Treanor <ChrisTrea...@discussions.microsoft.com> wrote: > This may be a non-issue but I wanted to check to see if anyone has done this > and ran into issues. > &...

Help please!!! What version do I have?
Dear Fellow Visio Users, I have a question regarding product packaging. I have some Visio files I created with Microsoft Visio 2000 but I don't recall if it was Technical or Professional (long story). I decided to buy Microsoft Visio 2000 Professional thinking it would be able to handle both. I googled and found what looked to be a reputable company to order from (even checked for feedback from various sites). I called them prior to ordering to "verify" I would in fact receive Microsoft Visio 2000 Pro versus Visio (the original company) 2000 Pro. The picture on their webs...

How do i find out what version of excel or works is on a computor?
Can anyone tell me how I can find out what version of works and also excel is on a computor? The usual quick method would be to click Help on the application's menu and then select About......in the dropdown list (usually at the bottom of the list). Rob "tootsieroll321" <anonymous@discussions.microsoft.com> wrote in message news:141001c4ac3b$73e5bb60$a401280a@phx.gbl... > Can anyone tell me how I can find out what version of > works and also excel is on a computor? Good answer from Rob but if you want to do it dynamically use =INFO("release") Value f...

CRM 3.0 Install Error with SQL Reporting Services and SQL 2005
Hi, Doing a CRM 3.0 Server installation. During the last page of the install wizard (or what I assume is the last page) when I goes through and does verification I get a red X next to SQL Reporting Services. The message I receive when I look at the details is: ***** The specified path is not a metabase path. Parameter name: path ***** Now SRS is installed and working. I put in the URL: http://<servername>/reportserver and every other variation on that I can find. Thoughts? Alan try http://servername/reports also assuming you did not use ssl... =======================...

Publisher 2003 should be fixed to accept previous versions data.
Pages with pictures on them that worked just fine in Office 2000 versions are distorted when opened in Publisher 2003...is there a fix yet as I am aware this has been reported before? ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/office/comm...

sql summarizing help
Hi All, Given: table1 --------- id, cdate, weeksago, amount, typeid, timeclose 496, 2010-02-11, 0, 450, 3, 1 490, 2010-02-01, 1, 200, 4, 1 491, 2010-02-01, 1, 350, 2, 2 493, 2010-02-01, 1, 500, 5, 1 489, 2010-01-21, 3, 150, 2, 1 136, 2010-01-12, 4, 500, 3, 2 137, 2010-01-12, 4, 100, 3, 1 138, 2010-01-12, 4, 500, 2, 1 1. i'm trying to create a sql that will give me a summary resultset grouped by weeksago. 2. i want to sum the columns and get counts based on typeid. 3. avg of timeclose here's the sql i have: select weeksago, , (sum(timeClose)/(count(timeclo...

SQL 'for xml' and C# example??
I'm missing some piece of the puzzle. I'm using 'for xml' type queries from SQL2K - and now trying to change the front-end from ADO to C#, I can't quite figure it out.. It seems that I could use an XmlReader.. and somehow use that instead of a DataReader.. but that didn't work.. I tried using a DataReader and get the byte array - but that wasn't right. SQL returns formatted XML, I need to load that XML into an XmlDocument somehow without ANY molestation of that dom. Any ideas? Examples? Missing links???? thanks THANKS!! I've been looking for the answer to ...

Project Server Cube Build Issue
I think I screwed up the install order on the SQL DMO components. According to MSDN: " At this time, do not use the feature packs for SQL Server 2008 to install and download these components, as those files will not allow you to build cubes in SQL Server 2008 Analysis Services with Project Server 2007." However, I didn't read that carefully enough and installed the Microsoft SQL Server 2008 Management Objects Collection instead of the 2005 version. Now I can't install the 2005 version even if I uninstall the 2008 version. The setup fails with the "highe...

Update multivalue field in table from form with SQL
Access 2007 on Vista I am using a form to establish the variables for a report before it is created. One field on the underlying table is a multivalue field, and the form includes a multi-select combo box control. After selections are made and the OK button on the multi-select combo drop down is clicked, focus moves to the next control. I have discovered though, that the underlying table does not update immediately, but does so correctly when I close the form. This sequence does not deliver the proper report data, so I need a way to immediately update the underlying table (m...

Refer to SQL statements globally
I have two large SQL statements that I need to use across several forms, reports, etc. Rather than repeat them in each form, I'm trying to store and reference them globally. For example, I'd like to store strSQL1 and strSQL2 in a global module, so I can use either like this in a form: Random form: Me!lstResults.RowSource = strSQL1 Random report: Me.Report.RecordSource = strSQL2 Would I just store the SQL statements in a global module like: Public Function SQLSource() As String Dim strSQL1 As String Dim strSQL2 As String strSQL1 = "SELECT blah blah...

To SQL or not to SQL?
I have a very vertical product developed 100% in M/S Access. I developed it myself in 1993 in the initial release of Access and been with it ever since. It is currently very stable and running in Access 2003. My big question is how or even *if* we should move it to SQL. My customers are getting bigger all the time with more users. Typically our customers run one or two workstations generally never more than 5. Performance, however, is starting to slow with database sizes passing 500 meg. We also have a LOT of code behind forms so are bound tightly to the Access development environ...

writeback to SQL 2005
hello! I use excel 2007 iI open a connection agianst SQL server 2005 and choose a table. In my workbook i can now see this data from this table. if i change a value in some cell i wish to writeback to table in SQL server. Is this possible? It's possible through the use of VBA and ADO, but not simply using the data connection you've already established. Ross "CJ" <CJ@discussions.microsoft.com> wrote in message news:D54EC521-0DD5-4B3D-971B-4FF3394D6FA8@microsoft.com... > hello! I use excel 2007 > iI open a connection agianst SQL server 2005 and choose a table...

which imf version do I have
I have had exchange sp2 installed and imf has been activated. I am having a lot of trouble getting it to work(have followed all links and from previous posts have had no luck). Everything has been set up correctly. I have tried to re-install exchange sp2 but it now states that the older version of imf is installed and to remove before updating. How did sp2 instal the first time. Their is nothing in the add/remove programs. How can I see the old version if it exists or is their software that can detect which version(s) are installed. (Now I am confused) You have IMF v1. Follow this to u...

Hyperlinks in 2003 version #3
My workplace just upgraded to Microsoft Office 2003. Can you insert a hyperlink to a pdf file, or does it just work for office files. I linked to a pdf file and it opens adobe for a split second then closes. Any ideas on what I am doing wrong? Thanks, Mike -- Cbravo212 ------------------------------------------------------------------------ Cbravo212's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=25615 View this thread: http://www.excelforum.com/showthread.php?threadid=390311 Try downloading some updates from Adobe's web site. I use 7.0 and experie...

PostgreSQL or other SQL servers in RMS
Has anyone successfully implemented RMS with one of the free SQL servers? Theoretically, is there any reason why we have to use MS SQL Server 2000 for large databases? David "dh" <dh@discussions.microsoft.com> ha scritto nel messaggio news:1783A90D-AF3E-4D91-A445-0039D4E7E379@microsoft.com... > Has anyone successfully implemented RMS with one of the free SQL servers? > Theoretically, is there any reason why we have to use MS SQL Server 2000 > for > large databases? RMS has implemented only for MS SQL Server (2000/MSDE) and isn't possible to work with ano...

DPM 2010 RC x86 version
Hi, Is there a 32 bit version of DPM2010 RC? I downloaded the RC from the Microsoft Connect site and tried to run it on my server that currently runs 2007 to upgrade it and it said it was not a vaild win32 application. The download did not specify weather it was 32 bit or 64 bit really. I remember in a couple of webcasts they said that a 32 bit version would be available. Does anyone know if this is true? Thanks DPM 2010 will only run on a WS08 & WS08R2 x64 machine. If you are running DPM 2007 SP1 on an x64 machine, then you there will be an inplace upgrade. If yo...

sql.request #2
Does anyone have a comprehensible guide on how to use it that a dolt like me can follow? Every time I try I get a #N/A. The only guide I can find is at http://www.bygsoftware.com/examples/zipfiles/UsingSqlRequest.zip but it's really hard to follow. From the MSDN Library: http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/office97/html/SEC41.asp Not sure how familiar you are with ODBC; but if you are getting #N/A as a result, it is usually because of problems either with the SQL syntax or the connection string. There are a few examples of connection strings in the re...

Restoreing newer version files back to an older computer with olde
I had a new computer with 2004 installed and copied files to a usb 2.0 cruzer drive. then took the new computer back because of tech problems. now I try to restore my files back to my old computer with 2002 , and money says that they are password protected, I never protected them with a password. Can someone Help?, GREATLY APPRECIATED!!! See http://umpmfaq.info/faqdb.php?q=84. Your case may come from different circumstances, but the diagnosis is exactly the same. You can't get there from here. "bblowney" <bblowney@discussions.microsoft.com> wrote in message news:665...

Uninstall office 2008
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel I've been having problems with my office install for a while now, it just refuses to update, saying the version of office required for the update isn't available. So i decided to uninstall the whole thing and reinstall it. However, the remove office app doesn't find any versions of office on my system :S Even though it's quite clearly there. I'm on snow leopard, but had these problems before i upgraded, too. Any ideas how i can remove it completely and reset everything so i can install it properly ...

MSDE or SQL Personal or SQL Developer? or SQL Workstation?
Hi, which one is better for personal non-server computer? MSDE? SQL Personal? SQL Developer? SQL Workstation? Thank you. It depends on what edition of GP you are going to run. If you are going to use Professional, you need to go with SQL Server developer, assuming you are installing on a non-server OS. "ano" wrote: > Hi, which one is better for personal non-server computer? MSDE? SQL Personal? > SQL Developer? SQL Workstation? > Thank you. Is the function of SQL Developer the same as Enterprise edition? How about personal edition? Can it be used for GP Pro? Can dev...

Excel RoundUp in Transact-SQL
Last week I posted the following computation in Excel... roundup(roundup(rate * 500),4) - roundup(rate * 200,4) + polfee,2) ((6.108934 * (500000/1000)) - (200 * 6.108934) + 1311.51) = 3144.20 In SQL using round(num,4) = 3144.19 I've moded this to... round(num+0.0005,4) = 3144.20 This works most of the time but occasionally I'm still off from what Excel returns. I'm under 2% in my 342 calcs, so it's do-able and we'll explain if any client notes this that we've reduced their pmt by .01 cents. BUT, I'd still like a way to replicate Excel'...

Pocket Version for Pocket PC 2003
I am unable to install the pocket version of Money because I am running Pocket PC 2003. When will this be updated? ...