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.
| Author |
Topic |
|
bill wooten
Starting Member
2 Posts |
Posted - 2002-12-19 : 15:07:44
|
| I want to create a stored procedure that is as clean as possible. I can get this to work with a cursor - but there should be a better way..I want to go against an existing list of system names, do a ping, and store the results back. I would settle for being able to create a temp file that had the system name and result in it. An example of checking one system is as follows..set nocount oncreate table #output(data varchar(255))declare @result intdeclare @system_name varchar(20)set @system_name = 'ping -n 1 systemnamehere'insert #output exec Master..xp_cmdShell @system_name--select @@rowcount-1 --Get rid of the single NULLselect @result = count(data) from #output where data like '%reply%'drop table #output |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2002-12-19 : 15:16:48
|
| You might want to consider doing this through vbscript instead. |
 |
|
|
bill wooten
Starting Member
2 Posts |
Posted - 2002-12-19 : 15:36:45
|
quote: You might want to consider doing this through vbscript instead. I am open to examples..
|
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2002-12-19 : 16:00:24
|
| This might help you out:[url]http://cwashington.netreach.net/depo/view.asp?Index=714&ScriptType=vbscript[/url] |
 |
|
|
|
|
|