Logging / error tracking in SQL server

HLRosenberger
HLRosenberger used Ask the Experts™
on
We have a WEB app that on occasion fails.  It's a page that write records to a SQl server database.   There is third party code involved, so a useless generic error page is displayed. Is there a  Logging / error tracking mechanism in SQL server where "bad" SQL statement are logged?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
HuaMin ChenProblem resolver
Commented:
Hi,
you can use Stored procedure in the database and then use

try ... catch

to track the sql problem.
IT Engineer
Distinguished Expert 2017
Commented:
If you're using SQL Server 2005 or 2008 you can run a trace with SQL Profiler to capture the SQL statements.
With SQL Server 2012 or 2014 you can use Extended Events to capture the same SQL statements.

Author

Commented:
thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial