password99
Technical User
Is there a way to get a list of the SQL Servers on a network through some mechanism supplied with the SQL Server (interface)?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
for /f "tokens=1" %%a in (netview.txt) do checkbox.bat %%a
sc %1 query bufsize= 10000 state= all | grep -i "SERVICE_NAME: MSSQL" > servlist.tmp
REM run.bat starts here.
@ECHO OFF
del namelist.txt
del netview.txt
net view > netview.txt
@for /f "tokens=1" %%a in (netview.txt) do checkbox.bat %%a
echo .
echo Done
REM run.bat ends here.
REM CheckBox.bat starts here.
@ECHO OFF
if "%1" == "" goto ErrorInParm
echo Checking %1
del *.tmp
copy blank.txt tempname.tmp > 1.tmp
sc %1 query bufsize= 10000 state= all | grep -i "SERVICE_NAME: MSSQL" > servlist.tmp
@for /f "tokens=1" %%b in (servlist.tmp) do if "%%b" == "SERVICE_NAME:" echo %1 > tempname.tmp
type tempname.tmp >> namelist.txt
goto ExitBatch
:ErrorInParm
echo ERROR. No input paramater.
goto ExitBatch
:ExitBatch
REM CheckBox.Bat ends here.