From: Abba on
Hello,

[SQL2005]

I want to setup a trace and capture Deadlock information. However I do not
want to use SQL profiler and instead write T-SQL to accomplish this. The
trace output should go to a table. When I checked sp_trace_create, it does
not mention about having table as output. When I created a trace in profiler
and exported the script, it mentions that "-- Client side File and Table
cannot be scripted"

How can I accomplish this?


TIA,
AbbA


From: Tibor Karaszi on
A server-side trace can only go to file, not table.

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi



"Abba" <sql_help(a)aaa.com> wrote in message
news:uM35ZNTqKHA.3848(a)TK2MSFTNGP06.phx.gbl...
> Hello,
>
> [SQL2005]
>
> I want to setup a trace and capture Deadlock information. However I do not
> want to use SQL profiler and instead write T-SQL to accomplish this. The
> trace output should go to a table. When I checked sp_trace_create, it does
> not mention about having table as output. When I created a trace in
> profiler and exported the script, it mentions that "-- Client side File
> and Table cannot be scripted"
>
> How can I accomplish this?
>
>
> TIA,
> AbbA
>
>
From: Uri Dimant on
Abba
SQL Server 2005 introduced a new graphical event to see deadlocks, have you
looked into the matter?

"Abba" <sql_help(a)aaa.com> wrote in message
news:uM35ZNTqKHA.3848(a)TK2MSFTNGP06.phx.gbl...
> Hello,
>
> [SQL2005]
>
> I want to setup a trace and capture Deadlock information. However I do not
> want to use SQL profiler and instead write T-SQL to accomplish this. The
> trace output should go to a table. When I checked sp_trace_create, it does
> not mention about having table as output. When I created a trace in
> profiler and exported the script, it mentions that "-- Client side File
> and Table cannot be scripted"
>
> How can I accomplish this?
>
>
> TIA,
> AbbA
>
>


From: Dan Guzman on
Direct the trace to a file on the server. Use can then use the function
fn_trace_gettable to retrieve the trace data in tabular form and load into a
table as desired. See fn_trace_gettable in the Books Online for details and
examples.

--
Hope this helps.

Dan Guzman
SQL Server MVP
http://weblogs.sqlteam.com/dang/


"Abba" <sql_help(a)aaa.com> wrote in message
news:uM35ZNTqKHA.3848(a)TK2MSFTNGP06.phx.gbl...
> Hello,
>
> [SQL2005]
>
> I want to setup a trace and capture Deadlock information. However I do not
> want to use SQL profiler and instead write T-SQL to accomplish this. The
> trace output should go to a table. When I checked sp_trace_create, it does
> not mention about having table as output. When I created a trace in
> profiler and exported the script, it mentions that "-- Client side File
> and Table cannot be scripted"
>
> How can I accomplish this?
>
>
> TIA,
> AbbA
>
>