Link to home
Start Free TrialLog in
Avatar of marrowyung
marrowyung

asked on

SQL server log to Windows event log

Dear all,

any way to drop the same SQL server log information to the Windows event log ?
SOLUTION
Avatar of SThaya
SThaya
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of marrowyung
marrowyung

ASKER

no, we want monitoring SQL server log from Windows event log. not the other way around !
ASKER CERTIFIED SOLUTION
Avatar of Raj-GT
Raj-GT
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
"used this method in the past with stored procedures to update windows event logs with certain SQL log events which I would then capture using our monitoring software."

this is exactly what I want !
You should be able to do the same by studying the links I provided.

Thanks,
Raj
how many time you implement this ?
it might not good enought as this one don't WRITE to the event log anyway! my monitoring tools can only read event log and send related information for us!
I don't work with SQL on a day-to-day basis anymore, but the following code should write an informational event in the Application event logs with event id 17061.

USE master;
EXEC xp_logevent 60000, 'Hello World', informational

Combine this with the first link which will show you how to enumerate the SQL logs from T-SQL and you will have what you want. I am afraid I don't have the resources to do this work for you.

Thanks,
Raj
" I am afraid I don't have the resources to do this work for you.


No need, but I read the link, it is about import the application event log to the SQL server temp table !

not from MS SQL server log to application log.
"USE master;
 EXEC xp_logevent 60000, 'Hello World', informational
"

this also means that only any error with "Hello world" only message will be logged, right?
and we can only execute one type of this one?

can we do :

1)USE master;
  EXEC xp_logevent 60000, 'Hello World', informational
2) USE master;
  EXEC xp_logevent 60000, 'error", informational
3) USE master;
  EXEC xp_logevent 60000, "alert", informational

the result is the effect of aLL of them?