Friday, February 24, 2012

Creating messages from SQL to the Windows Event Viewer app log

(For MS SQL 2000... Please don't suggest anything using VB or .NET. I need
something either somehow built-in with SQL 2000 or using VBscript.)
Anyone know of a way to create a test message somehow through MS SQL so that
it shows in the Windows application event log?
For example, would creating a job to run a dummy stored procedure create an
entry in the app event log?
(Problem is that when SQL is clustered, it uses a different 'source' name in
the event viewer. The 'source' name can't be different when writing a
simple script from what I can tell. I need to be able to easily create test
messages using the SQL cluster name.)
MarcoMarco Shaw wrote:
> (For MS SQL 2000... Please don't suggest anything using VB or .NET. I need
> something either somehow built-in with SQL 2000 or using VBscript.)
> Anyone know of a way to create a test message somehow through MS SQL so that
> it shows in the Windows application event log?
> For example, would creating a job to run a dummy stored procedure create an
> entry in the app event log?
> (Problem is that when SQL is clustered, it uses a different 'source' name in
> the event viewer. The 'source' name can't be different when writing a
> simple script from what I can tell. I need to be able to easily create test
> messages using the SQL cluster name.)
> Marco
>
>
Have you looked at RAISERROR?
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||This is a multi-part message in MIME format.
--=_NextPart_000_06FD_01C6A732.93A36440
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
RAISERROR( 'This is a test event message', 10, 1 ) WITH LOG
-- Arnie Rowland
"To be successful, your heart must accompany your knowledge."
"Marco Shaw" <marco@.Znbnet.nb.ca> wrote in message =news:OAXoOx2pGHA.1600@.TK2MSFTNGP04.phx.gbl...
> (For MS SQL 2000... Please don't suggest anything using VB or .NET. =I need
> something either somehow built-in with SQL 2000 or using VBscript.)
> > Anyone know of a way to create a test message somehow through MS SQL =so that
> it shows in the Windows application event log?
> > For example, would creating a job to run a dummy stored procedure =create an
> entry in the app event log?
> > (Problem is that when SQL is clustered, it uses a different 'source' =name in
> the event viewer. The 'source' name can't be different when writing a
> simple script from what I can tell. I need to be able to easily =create test
> messages using the SQL cluster name.)
> > Marco
> > >
--=_NextPart_000_06FD_01C6A732.93A36440
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

RAISERROR( 'This is a test =event message', 10, 1 ) WITH LOG
-- Arnie Rowland"To be =successful, your heart must accompany your knowledge."
"Marco Shaw" =wrote in message news:OAXoOx2pGHA.1600@.TK2MSFTNGP04.phx.gbl...> =(For MS SQL 2000... Please don't suggest anything using VB or .NET. I need> something either somehow built-in with SQL 2000 or using VBscript.)> > Anyone know of a way to create a test =message somehow through MS SQL so that> it shows in the Windows =application event log?> > For example, would creating a job to run a dummy =stored procedure create an> entry in the app event log?> > =(Problem is that when SQL is clustered, it uses a different 'source' =name in> the event viewer. The 'source' name can't be different =when writing a> simple script from what I can tell. I need to be =able to easily create test> messages using the SQL cluster name.)> => Marco> > >

--=_NextPart_000_06FD_01C6A732.93A36440--

No comments:

Post a Comment