July 30, 2010     |
Network Toaster
SQL Security Forums
Note: SQLSecurity.com does not allow nor require registration due to privacy concerns for users. SQLSecurity.com is open and anonymous for all. Please report any abuse or profanity.
Reply To Message:
Posted By n/a on 1/1/2001
Subject: Logging
Message: Sure - you can use the sp_trace procedures to log the data as in the following:
alter procedure sp_mytrace
as
declare @tid int
exec sp_trace_create @traceid = @tid OUTPUT , @options = 1 , @tracefile = N'c:\trace.txt'
exec sp_trace_setevent @traceid = @tid, @eventid =14, @columnid = 1, @on =1
exec sp_trace_setevent @traceid = @tid, @eventid =15, @columnid = 1, @on =1
exec sp_trace_setstatus @traceid = @tid, @status = 1
go
exec sp_procoption 'sp_mytrace', 'startup', 'true'

Sorry I didn't have time to test this but using my example and touching it up with Books Online you should be in business. Make sure to include the additional columns you are interested in such as NT Login Name etc...

Chip
UserName: 
Subject:  Capturing LOGIN INFORMATION
Body:
  
Show Replies:


ActiveForums 3.6
Copyright 1999 by Chip Andrews   |  Privacy Statement  |  Terms Of Use