sp_OACreate and Win32_NTLogEventLog in a Stored Procedure

Posted on 2003-03-31
Medium Priority
Last Modified: 2010-08-05
Hi there,

I have a stored procedure which among other things, needs to log custom error messages to the NT Event Log.  I have managed to discover the sp_OACreate stored procedure, but can any one tell me how to use it with the Win32_NTLogEventLog class.  If I could just get hold of the progid for Win32_NTLogEventLog or one of it's other components, then I am sure I could handle it from there.

Any suggestions?

Thanks in advance.
Question by:Pixie
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Assisted Solution

fz2hqs earned 200 total points
ID: 8239084
Have you looked at xp_logevent instead? No need to reinvent the wheel ;)

Accepted Solution

TheSpirit earned 200 total points
ID: 8244212
Hi Pixie,
I would try and avoid sp_oa* I once thought it would be a good idea to use them but although it worked I introduced a whole world of hurt in terms of memory leaks (admitedly in my code)... Fz2hqs is correct xp_logevent and raiseerror
(read Books On Line for details on this)

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
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…
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Suggested Courses

801 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