Internet Access Stored Procedures for SQL Server 7.0, 2000, 2005 (Win32)
These procedures are implemented in xpFileUtils library.
This adds to T-SQL access to internet hosts and websites.
There are the following procedures:
xp_IsPortOpen checks (scans) if the host has the given port open;
xp_GetAddrByHost returns the IP address for the given host name;
xp_GetHostByAddr returns the host name for the given IP address;
xp_Ping returns statistics of ping operation like
ping.exe utility does;
xp_CanPing only checks if the destination host can be pinged (e.g. reachable);
xp_TraceRoute returns statistics of trace route operation like
tracert.exe utility does.
xp_Whois on the given internet address, performs requests to international WHOIS databases and returns any available registration data;
Check if the host address ('localhost') is available using default parameters (3000 ms timeout, 4 attempts):
declare @result int
exec @result = master..xp_CanPing 'localhost'
if @result = 1
print 'The destination host is available'
if @result = 0
print 'The destination host is unavailable'
print 'Network failure'
Related DocumentsInternet ToolsInternet components (ping, trace route, whois, port scan)