I manage lots of SQL Servers. Many times I forget how many server I have and what are their names. New servers are added frequently and old servers are replaced with powerful servers. I run following script to check if server is properly set up and announcing itself. This script requires execute permissions on XP_CMDShell.
CREATE TABLE #servers(sname VARCHAR(255))
INSERT #servers (sname)
EXEC master..xp_CMDShell 'ISQL -L'
DELETE
FROM #servers
WHERE sname='Servers:'
OR sname IS NULL
SELECT LTRIM(sname)
FROM #servers
DROP TABLE #servers
Reference : Pinal Dave (http://blog.SQLAuthority.com)





Hi all!
Very interesting information! Thanks!
G’night
Hi all!
Looks good! Very useful, good stuff. Good resources here. Thanks much!
Bye
Hey
Thanx a lot for this….it was really helpfull when i had to find wich servers on my network had SQL installed…My network has app. 3500 servers and this worked like a charm
Sincerely
Jan Simon
Thanks for this information.I need more information
if you provide me some query where I find all the server name,version name and service pack information
Its very helpful and important information, while working in big organizations or corporations.
tks.
Hi Dave,
I want one help that I have SQL Server List which containing 500 SQL Server Instance name. Now I have to fetch the below details:
SQL Server Version Installed
List of database on that server
by using T-SQL Script.
Do you have any idea or please help me?
Thanks n Regards
Rajni Kant Ranjan
[...] SQL SERVER – Script to find SQL Server on Network [...]
[...] of all the SQL Server on local network. I remembered that I had written similar script a year ago SQL SERVER – Script to Find SQL Server on Network. When I looked at it, I realize that I had written it for SQL Server 2000 and used [...]
CREATE TABLE #servers(sname VARCHAR(255))
INSERT #servers (sname)
EXEC master..xp_CMDShell ‘ISQL -L’
I get error on sql2005 … “‘ISQL’ is not recognized as an internal or external command,”
any idea why??
Todd, Please use the SQLCMD or OSQL because ISQL was supported in SQL 2000 and its now obsolete!!
Just replace it.
Awsome it worked for me
Use this for SQL server 2005
CREATE TABLE #servers(sname VARCHAR(255))
INSERT #servers (sname)
EXEC master..xp_CMDShell ‘OSQL -L’
DELETE
FROM #servers
WHERE sname=’Servers:’
OR sname IS NULL
SELECT LTRIM(sname)
FROM #servers
DROP TABLE #servers
This is a good script for finding servers on the network. However, do you have a script to show which sql version and edition are on these servers? Please advise