Show IP address

  • Hi everyone

    Can anyone offer some advice on how to show the IP address of current connect machine within a TSQL script?

     

    many thanks

  • declare @t varchar(100)

    select @t = 'ping ' + host_name()

    exec master..xp_cmdshell @t

  • Thanks very much for this.

    Guess it was my fault for not explaining correctly. Need a bit more info.

     

    I need to get the IP address of the machines I have connected to via QA.

    For instance I have all my servers registered at A , but connect to SQL server B via QA.

    How do I get the IP address of B ?

     

    thanks for any help

  • exec master..xp_cmdshell 'ipconfig'

  • Spot on .. thank you

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply