Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accessing the Windows Application Log

Status
Not open for further replies.

laker42

Programmer
Feb 11, 2003
60
US
I am trying to capture some data that is being written to the Windows application log. I can't find a way to do this via TSQL. Does anyone know of a way to do this?

I did find a stored procedure named sp_eventlog but it is undocumented. It accepts 4 parameters but I can't figure out what they are. Anyone know if this will accomplish what I am trying to do?

I would appreciate any info you can offer!

Thanks,
John
 
If you're using SQL Server 7.0, you can use SQL Server's undocumented xp_eventlog extended stored procedure to return a result set of entries for a specific event log.

(Unfortunately, the xp_eventlog extended stored procedure doesn't work in SQL Server 2000.) The following example shows how you can retrieve the contents of the Application log:

xp_eventlog 'Application'



Thanks

J. Kusch
 
Thanks for the reply. I have already tried the xp_eventlog but like you said, it does not work on SQL 2000. I am trying to accomplish using a different method but haven't found it yet.

John
 
A workaround would be to get the W2K Resource Kit utility called DUMPEL. here is the link ...



With this you could dump the Event Log, application, system or dns, out to a file and then import it into SS as you need it.

may need to use xp_cmdshell but be wary of the security issues in doing so.

May also need to keep track of when you dump and import in the area of bringing duplicate records in that you have already processes in past dump/imports.

Hopes this gets you a little closer.

Thanks

J. Kusch
 
Jay,
Thanks for the response. I was already started down the path that you indicated. I have been testing the dumpel.exe and it seems like it may do what I want. Not quite as clean as I had hoped but it should do the trick.

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top