Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Wednesday, February 19, 2025 
 
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!
 Data & Imports Forums - T-SQL & Queries
Forum to discuss general T-SQL questions and help with queries related to SalesLogix data. View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to T-SQL & Queries | New ThreadView:  Search:  
 Author  Thread: Creating Audit Records Using Triggers (SQL2000)
Binu James
Posts: 3
 
Creating Audit Records Using Triggers (SQL2000)Your last visit to this thread was on 1/1/1970 12:00:00 AM
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?
[Reply][Quote]
Craig
Posts: 13
 
Re: Creating Audit Records Using Triggers (SQL2000)Your last visit to this thread was on 1/1/1970 12:00:00 AM
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
[Reply][Quote]
Binu James
Posts: 3
 
Re: Creating Audit Records Using Triggers (SQL2000)Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Feb 07 4:16 PM
fiogf49gjkf0d
Host Name does not help as this is a citrix environment and the hostname is same for all users
[Reply][Quote]
Jim Crowley
Posts: 8
 
Re: Creating Audit Records Using Triggers (SQL2000)Your last visit to this thread was on 1/1/1970 12:00:00 AM
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.
[Reply][Quote]
 Page 1 of 1 
  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!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 2/19/2025 4:44:31 PM