Use SQL Server Profiler to view exception information

Source: Internet
Author: User

DebuggingProgramSometimes or some ides may not provide detailed database exception information. SQL Server Profiler is a graphical user interface for SQL tracking. It can monitor database engines and analysis services. When using LINQ to SQL or ADO. NET Entity Framework, you can use it to clearly understand the statements they have executed on the database. We can also use it to track database exceptions.

SQL Server Profiler is opened by starting --> All Programs-> Microsoft SQL Server 2008 --> Performance Tools-> SQL Server Profiler.

Click file --> Create trail, enter the database connection information, and select connection. By default, the standard template is used. It does not track exceptions. If you want to track exceptions, switch to the "Event Selection" tab first.

Click Show all events in the lower right corner, and select the check boxes before exception and user error messages in errors and warnings. Other check boxes can be selected as needed. After the selection is complete, run the task on a single machine and start tracking.

Then execute the program to be debugged and let it perform database operations. If you have selected some check boxes under tsql, SQL Server Profiler records the T-SQL statements executed by the program. When an exception occurs in the query, SQL Server Profiler records the exception information and displays it, just like querying in SQL Server Management studio.

This tool can also be used to track database exceptions in non-debugging environments.

This article applies to Microsoft SQL Server 2008, Microsoft SQL Server 2008 SP1

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.