Get the IP address of the SQL server (from 9CBS Zou Jian)

xiaoxiao2021-03-06  64

Create Table #TB (o VARCHAR (250)) DECLARE @SQL VARCHAR (500) SET @ SQL = 'ping' @@ servernameinsert Into #tb exec master..xp_cmdshell @SQL

Select @ SQL = o from #tb where o like 'pinging%' select @ SQL = Substring (@ SQL, Charindex ('[', @ SQL) 1,500), @ SQL = Left (@ SQL, Charindex (']' , @ SQL) -1) Print @SQL

Drop Table #TB

转载请注明原文地址:https://www.9cbs.com/read-89961.html

New Post(0)