Solved

10774: trigger DML- IP and  MAC address

Posted on 2014-10-17
3
213 Views
Last Modified: 2014-10-17
In my table audit I keep the Ip and address of MAC of the machine that is running the application and those data to get from my web application and control as parameters in the procedure to insert into the table, in the case of Trigger, How could I get the IP and MAC?
0
Comment
Question by:enrique_aeo
  • 2
3 Comments
 
LVL 39

Assisted Solution

by:lcohan
lcohan earned 500 total points
Comment Utility
--IP:
SELECT client_net_address as IP_Address FROM sys.dm_exec_connections

--MAC:

SELECT hostname, net_library, net_address FROM sys.sysprocesses
where len(hostname)>0
0
 

Author Comment

by:enrique_aeo
Comment Utility
but the mac address and IP must be the web application that connects, should not be the server, can not use the parameters sent from the web application on the trigger?
0
 
LVL 39

Accepted Solution

by:
lcohan earned 500 total points
Comment Utility
The two statements I posted above will return the IP and MAC address from the Client process (SPID) connected to SQL and I thought that's what you wanted to use in your trigger right?
For more details about those two DMViews you could check SQL BOL:

http://msdn.microsoft.com/en-us/library/ms181509.aspx
http://msdn.microsoft.com/en-us/library/ms179881.aspx
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now