SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Stairway to Server-side Tracing - Step 2: Creating a SQL Trace Using T-SQL (Stairway Series)


Stairway to Server-side Tracing - Step 2: Creating a SQL Trace Using T-SQL (Stairway Series)

Author
Message
Dan Guzman-481633
Dan Guzman-481633
Old Hand
Old Hand (395 reputation)Old Hand (395 reputation)Old Hand (395 reputation)Old Hand (395 reputation)Old Hand (395 reputation)Old Hand (395 reputation)Old Hand (395 reputation)Old Hand (395 reputation)

Group: General Forum Members
Points: 395 Visits: 407
majinbao (11/7/2013)
Thank you very much for the post. great articles.

the only information I can get is object:alert, but it doesn't tell me the TextData is null. I can not tell what happened to this database.

any solution? thanks.


The Object:Altered event does not expose the statement text. If you need the text data too, you can include the SQL:Statement Completed event, filtered accordingly (i.e. LIKE '%ALTER%'. The SQL:Statement Completed event can then be correlated with the Object:Altered based on TransactionID included in both events. Assuming you are leveraging the default trace for the Object:Altered event, a separate trace for the SQL:Statement Completed event will be needed.
harvey007
harvey007
Forum Newbie
Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: General Forum Members
Points: 6 Visits: 14
http://idealprogrammer.com/net-languages/c/idealsqltracer-simple-free-open-source-alternative-sql-profiler/ =>IdealSqlTracer is a nice open source C# project on github that uses sp_trace_create, sp_trace_filter, sp_trace_setstatus sql procs to create custom traces for you.. The advantage of IdealSqlTracer is that it takes all of the sql generated behind the scenes in a desktop application or web page, and it formats it to make it easily readable. The formatted sql is put into notepad so that you can cut-n-paste the sql and run it directly in Sql Server Management Studio (SSMS). The advantage of doing this is that it makes it possible for you to see exactly what is going on in your application or website. I have found this to be a great debugging tool for me as a programmer.

Here is an example screen shot of the formatted sql that is placed into notepad:

Thanks, Wade Harvey
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search