Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 307
  • Last Modified:

sp_OACreate and Win32_NTLogEventLog in a Stored Procedure

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.
Pix
0
Pixie
Asked:
Pixie
2 Solutions
 
fz2hqsCommented:
Have you looked at xp_logevent instead? No need to reinvent the wheel ;)
0
 
TheSpiritCommented:
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)
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now