To extend on Steve, here's a code snippet that might give you some ideas
set nocount on
declare @ip varchar(255), @cmd varchar(100)
set @cmd = 'ping ' + HOST_NAME()
create table #temptb (grabfield varchar(255))
insert into #temptb exec master.dbo.xp_cmdshell @cmd
select @ip = substring(grabfield, charindex('[',grabfield)+1,
charindex(']',grabfield)-charindex('[',grabfield)-1) from #temptb where left(grabfield,7) = 'Pinging'
print @ip
drop table #temptb
set nocount off
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]