Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Old Forums
 CLOSED - General SQL Server
 Detect SQL Servers

Author  Topic 

jps
Starting Member

5 Posts

Posted - 2006-06-09 : 11:59:18
Hi All,

What I need is a script like vbs which returns a list of all sql 2000/2005 servers on the local networks.

Is it likely?

Thx

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2006-06-09 : 12:21:59
http://www.sqlteam.com/item.asp?ItemID=5403

Go with the flow & have fun! Else fight the flow
Blog thingie: [URL="http://weblogs.sqlteam.com/mladenp"]
Go to Top of Page

sanjnep
Posting Yak Master

191 Posts

Posted - 2006-06-09 : 12:23:06
You can run on command prompt
isql -L which gives all the sql server running on network.
You can use xp_cmd command to execute this command from query analyzer. You can easily call it from vb.
Thanks
Sanjeev OH

use master
create procedure s_list_servers
as
xp_cmdshell 'isql -L'
--something like this ....
Go to Top of Page

jps
Starting Member

5 Posts

Posted - 2006-06-13 : 09:43:24
Osql/Isql /L returns a list of SQL servers. How could I check their versions?
Go to Top of Page

sanjnep
Posting Yak Master

191 Posts

Posted - 2006-06-13 : 10:02:46
After getting list of sql server you can use isql to connect each server and run @@version on each server which will give you the version of each server. If you need coding for this I may write it.

Sanjeev Shrestha
Go to Top of Page

jps
Starting Member

5 Posts

Posted - 2006-06-13 : 10:32:58
Hi sanjnep,

I am not good at SQL. What I need is to fill up my VB dropdown list with a list of sql servers, which have sql 2k /2k5.

I'll really appreciate if you can post your code here.

Thanks

Go to Top of Page

sanjnep
Posting Yak Master

191 Posts

Posted - 2006-06-13 : 11:23:03
I will write the code this evening.
Thanks
Sanjeev
Go to Top of Page
   

- Advertisement -