vbscripts to know the version sql server

  • I need a scripts in vbscripts to know the version sql server of several servers sql server 2000 and 2005. I have the scripts which connect in all server of the list, but i can't to write in the archive text the result of the scripts. I need to write in this archive the server + the version sql.

    For example: server0101 SQL Server 2005 Enterprise Edition

  • i guess your vbscripts are creating a connection and querying each server, right?

    there's an excellent MS article on this kind of info:

    http://support.microsoft.com/kb/321185

    vasically it suggests this as the query:

    SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')

    --results

    Release | Sqlservr.exe

    RTM | 2005.90.1399

    SQL Server 2005 Service Pack 1 | 2005.90.2047

    SQL Server 2005 Service Pack 2 | 2005.90.3042

    SQL Server 2005 Service Pack 3 | 2005.90.4035

    with those known values, you could build a CASE statement to returnt eh proper description for hte service pack.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • yes, know this scripts, but How I do this in vbscripts?

  • too many variables; show us your current vbscripts, and we can offer suggestions. most likely, it's nothing more than reading recordset values into some local vbscript variables, and writing those values to a file.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • jinette.andelo (8/10/2009)


    yes, know this scripts, but How I do this in vbscripts?

    What are you doing that requires this to be done from VBS?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Hi!!..

    I am trying to do a tour of several servers, and through a scripts vbscripts execute and make the connection to each one and copy a text file in the server name and the type of sql server, for example : if it's standard or enterprise

    Thanks

  • SQl Recon is a free tool that is much more robust than any vbscript you might use; it will find SQL instances you may not be aware of.

    it can provide the information you are looking for, and of course you can save the results.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • I agree with Lowell... unless you're doing this just for fun or, maybe, you're trying to build your own version of it for profit, purchasing SQL Recon will probably be cheaper than trying to grow your own.

    Still, that doesn't answer your question. I don't know about new things in VBS but in the "old days" , I would open an ADO connection to the known server and execute SELECT @@VERSION. Then, I'd use VBS to parse the result set from that to find the build number and play it against the list of build that Microsoft maintains. I believe that you can skip most of the parsing (as of SQL Server 2000 if I recall) by SELECTing SERVERPROPERTY with the appropriate option.

    To get the list of servers on a Domain, I'd use OSQL with the "list" flag. Coming up with the passwords was another story. And, no, sorry... I've lost track of the little program that did all of that for me years ago.

    Heh.. or, you could go for blood and interogate the registry of each server. Be real careful if you do.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply