Select Server IP Address?

  • Does anyone know of a way to select the server's IP Address(s) through SQL? Thanks.

    -Pat

  • create table #T ( data varchar(255))

    insert into #T

    exec master..xp_cmdshell 'ipconfig'

    select substring(data, charindex(':',data,1)+2, len(data) - charindex(':',data,1))

    from #T

    where data Like'%IP Address%'

    hth


    * Noel

  • Thanks Noel ! That's perfect.

    -Pat

  • Glad I can help

     


    * Noel

  • Very cool, except I don't have sufficient permissions to run it as a developer.  I'll have to try it on my laptop some time.  Definitely a useful implementation for doing quite a number of things.

    -----
    [font="Arial"]Knowledge is of two kinds. We know a subject ourselves or we know where we can find information upon it. --Samuel Johnson[/font]

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

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