简体   繁体   中英

SQL server profiler in the background with data saved to table

I want to run sql server profiler in the background. I know you can use SQL Trace but I want the trace info saved in a table and not in a file, and as far as I know you can only save to a file using SQL Trace.

What I am trying to do is leave sql trace running in the background and whenever an asp page generates a 500 error I send an email to the admin. Among the IIS related info in the email, I also want to include the last 50 lines from the trace. That is why I need the info in a table, so I can easily send it in the email.

You can use SQL Profiler (in 2005 / 2008) to save the results to a table by selecting the Save to table checkbox when creating the trace.

Note: Before proceeding you should read this article

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM