locked
How to grab ip address of remote connection to store in table RRS feed

  • Question

  • Hey guys move if in wrong area

     

    I am trying to create a bit of a VPN program using sql server.

    I have figured out how to have a form grab the users ip address and port from a tcp connection and store it into a table.

    Now I want to integrate this directly into the sql server.

    I know you can filter connections by IP using login triggers but is there a way to do the same when a command is issued to the database.

    Monday, October 4, 2010 3:47 PM

Answers

  • Powmax,

    Please query the table sys.dm_exec_connections, on column client_net_address , you can find the IP Address


    Sivaprasad S http://sivasql.blogspot.com Please click the Mark as Answer button if a post solves your problem!
    • Marked as answer by Powmax Tuesday, October 5, 2010 2:30 PM
    Tuesday, October 5, 2010 12:38 AM

All replies

  • I understand that you now have a table that contains the IP Addresses of the users of your SQL Server. But I can't tell what you want to do with that "when a command is issued to the database". Can you clarify?
    Rick Byham, Microsoft, SQL Server Books Online, Implies no warranty
    Monday, October 4, 2010 10:10 PM
  • Powmax,

    Please query the table sys.dm_exec_connections, on column client_net_address , you can find the IP Address


    Sivaprasad S http://sivasql.blogspot.com Please click the Mark as Answer button if a post solves your problem!
    • Marked as answer by Powmax Tuesday, October 5, 2010 2:30 PM
    Tuesday, October 5, 2010 12:38 AM
  • Thank you very much I have now been able to dynamically add new data to my connections table for my VPN

     

    even found the port column to :)

    Tuesday, October 5, 2010 2:31 PM