August 10, 2009 at 12:26 pm
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
August 10, 2009 at 12:40 pm
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
August 10, 2009 at 12:52 pm
yes, know this scripts, but How I do this in vbscripts?
August 10, 2009 at 1:59 pm
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
August 10, 2009 at 5:43 pm
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
Change is inevitable... Change for the better is not.
August 12, 2009 at 11:40 am
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
August 12, 2009 at 12:44 pm
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
August 12, 2009 at 7:30 pm
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
Change is inevitable... Change for the better is not.
Viewing 8 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply