Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
0 down vote favorite


i am trying to get sql server error logs. i search so much on net but do not get much info.



i find path C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\Log where SQL logs is been save in a file.i want to retieve this with vc++

In registery what is a path for this file like.

(HKEY_LOCAL_MACHINE\"Software\Microsoft\Microsoft SQL Server\)..if there is any API for it than also kindly suggest me a link..
Posted
Comments
Maciej Los 6-May-14 4:16am    
The same question is on SO: http://stackoverflow.com/questions/23473126/how-to-retrieve-sql-error-logs
Member 10678759 6-May-14 6:28am    
that is by me only no answer there too..:(

1 solution

As is described here: Location of SQL Server Error Log and Windows Event Log[^] sql log path varies by sql server version and instance name.

You need to use SqlDataSourceEnumerator[^] class to get list of available ms sql server with its instance names and versions.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900