–1:得到客户端的IP地址 /************* IP **************/ declare @ip varchar(20),@hst varchar(20),@sql varchar(100) declare @str varchar(100) set @str=’PING ‘+Host_Name() create table #tmp(aa varchar(200)) insert #tmp exec master..xp_cmdshell @str select top 1 @ip = replace(left(aa,charindex(‘:’,aa)-1),’Repl