2/19/2025 3:58:13 PM
|
|
slxdeveloper.com Community Forums |
|
|
|
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
Forum to discuss general T-SQL questions and help with queries related to SalesLogix data. View the code of conduct for posting guidelines.
|
|
|
|
Creating Audit Records Using Triggers (SQL2000)
Posted: 12 Feb 07 9:56 PM
|
fiogf49gjkf0d I am trying to use triggers to write to an external audit table. The NT_user in sysprocesses seems to be blank when the db user is sysdba. Is there any way to capture who the Windows user is? |
|
|
|
Re: Creating Audit Records Using Triggers (SQL2000)
Posted: 13 Feb 07 7:46 AM
|
fiogf49gjkf0d Since all the connections share sysdba user account, the next best thing might be the host variable. This would identify the computer at least. You can use Host_Name() in the trigger body.
Craig |
|
|
| |
|
Re: Creating Audit Records Using Triggers (SQL2000)
Posted: 14 Feb 07 3:51 PM
|
fiogf49gjkf0d I'm not sure about getting the nt_user, but what could work would be getting the createuser or modifyuser (which would be the slx userid) from the inserted or deleted tables (system tables from the LDF) in your trigger. For example within your Insert Trigger statement on a table, it would be something like:
INSERT YOURAUDITTABLE (FIELD1, FIELD2, MODIFYUSER) SELECT 'something' AS FIELD1, 'something else' AS FIELD2, MODIFYUSER AS MODIFYUSER FROM INSERTED
I know it's not what you were specifically asking, but maybe it will help. |
|
|
|
You can
subscribe to receive a daily forum digest in your
user profile. View the site code
of conduct for posting guidelines.
Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
|
|
|
|
|
|
|
|