Read LFD(log ) file SQLserver 2008
-
Creating a trace is also possible for Sql Express. Google Harder :)
Bastard Programmer from Hell :suss:
Hi, but trace can only catch the Error not the work i wanna.
-
Hi, but trace can only catch the Error not the work i wanna.
You can't always expect a solution to your problem to be handed to you. Google is one of the best resources for finding answers to programming questions. If you don't get the answer you are looking for, restructure your Google key words until you get an answer that will work for you. Basically it's the best way to learn anyway, by doing it yourself.
-
Hi, but trace can only catch the Error not the work i wanna.
-
You're right. A trace logs all actions. I'm not sure why you keep insisting that it won't work.
Bastard Programmer from Hell :suss:
thanks for Solution! is it posssible for you to give me small
Example
on how to use trace for all action. -
thanks for Solution! is it posssible for you to give me small
Example
on how to use trace for all action. -
There are quite some examples on the internet; some are based on Sql-statements, others on SMO. It's your turn to do some research :)
Bastard Programmer from Hell :suss:
I know that i should do the rest of work but i am little week in Googling.I didnt find any result that can give me the way.plz give me the link or Exmaple. Plz thanks
-
I know that i should do the rest of work but i am little week in Googling.I didnt find any result that can give me the way.plz give me the link or Exmaple. Plz thanks
-
Thanks for reply! I have create App. and trace everything in SQL but I cannot trace SP and ... that will call from C#. I mean when i call SP in C# it doesnt trace.
//را یکبار اجرا نمایید SP این trace ابتدا باید برای فعال کردن declare @TraceId int -- create the trace exec sp_trace_create @TraceId output, 0, N'C:\Temp\OurDemoTrace' -- set event and columns to trace exec sp_trace_setevent @TraceId, 12, 1, 1 exec sp_trace_setevent @TraceId, 12, 6, 1 exec sp_trace_setevent @TraceId, 13, 1, 1 exec sp_trace_setevent @TraceId, 13, 6, 1 -- start the trace exec sp_trace_setstatus @TraceId, 1 -- check status for our trace select value from fn_trace_getinfo(@TraceId) where property in (2, 5) go
sb.AppendLine("\nEventClass: " + ts.GetString(ts.GetOrdinal("EventClass")));
sb.AppendLine("NTUserName: " + ts.GetString(ts.GetOrdinal("NTUserName")));
sb.AppendLine("Command : " + ts.GetString(ts.GetOrdinal("TextData"))); -
Thanks for reply! I have create App. and trace everything in SQL but I cannot trace SP and ... that will call from C#. I mean when i call SP in C# it doesnt trace.
//را یکبار اجرا نمایید SP این trace ابتدا باید برای فعال کردن declare @TraceId int -- create the trace exec sp_trace_create @TraceId output, 0, N'C:\Temp\OurDemoTrace' -- set event and columns to trace exec sp_trace_setevent @TraceId, 12, 1, 1 exec sp_trace_setevent @TraceId, 12, 6, 1 exec sp_trace_setevent @TraceId, 13, 1, 1 exec sp_trace_setevent @TraceId, 13, 6, 1 -- start the trace exec sp_trace_setstatus @TraceId, 1 -- check status for our trace select value from fn_trace_getinfo(@TraceId) where property in (2, 5) go
sb.AppendLine("\nEventClass: " + ts.GetString(ts.GetOrdinal("EventClass")));
sb.AppendLine("NTUserName: " + ts.GetString(ts.GetOrdinal("NTUserName")));
sb.AppendLine("Command : " + ts.GetString(ts.GetOrdinal("TextData")));jojoba2011 wrote:
and trace everything in SQL but I cannot trace SP and ... that will call from C#.
I mean when i call SP in C# it doesnt trace.Not quite everything; stored procedures have their own trave_event, specifically SP:StmtStarting (44) and SP:StmtCompleted (45). A complete list of events can be found here[^].
Bastard Programmer from Hell :suss:
-
jojoba2011 wrote:
and trace everything in SQL but I cannot trace SP and ... that will call from C#.
I mean when i call SP in C# it doesnt trace.Not quite everything; stored procedures have their own trave_event, specifically SP:StmtStarting (44) and SP:StmtCompleted (45). A complete list of events can be found here[^].
Bastard Programmer from Hell :suss:
thanks a lot
Eddy Vluggen.
Your really an export in SQL. I have use this for SP:declare @TraceId int
-- create the trace
exec sp_trace_create @TraceId output, 0, N'C:\Temp\SQLLog'
-- set event and columns to trace
exec sp_trace_setevent @TraceId, 12, 1, 1
exec sp_trace_setevent @TraceId, 12, 6, 1
exec sp_trace_setevent @TraceId, 13, 1, 1
exec sp_trace_setevent @TraceId, 13, 6, 1
exec sp_trace_setevent @TraceId, 12, 13, 1
exec sp_trace_setevent @TraceId, 12, 10, 1
exec sp_trace_setevent @TraceId, 12, 13, 1
exec sp_trace_setevent @TraceId, 12, 14, 1
exec sp_trace_setevent @TraceId, 12, 15, 1
exec sp_trace_setevent @TraceId, 13, 10, 1
exec sp_trace_setevent @TraceId, 13, 13, 1
exec sp_trace_setevent @TraceId, 13, 14, 1
exec sp_trace_setevent @TraceId, 13, 15, 1
exec sp_trace_setevent @TraceId, 12, 35, 1
exec sp_trace_setevent @TraceId, 13, 35, 1
exec sp_trace_setevent @TraceId, 44, 10, 1
exec sp_trace_setevent @TraceId, 44, 13, 1
exec sp_trace_setevent @TraceId, 44, 14, 1
exec sp_trace_setevent @TraceId, 44, 15, 1
exec sp_trace_setevent @TraceId, 44, 1, 1
exec sp_trace_setevent @TraceId, 44, 6, 1
exec sp_trace_setevent @TraceId, 44, 35, 1
exec sp_trace_setevent @TraceId, 45, 35, 1
exec sp_trace_setevent @TraceId, 45, 10, 1
exec sp_trace_setevent @TraceId, 45, 13, 1
exec sp_trace_setevent @TraceId, 45, 14, 1
exec sp_trace_setevent @TraceId, 45, 15, 1
exec sp_trace_setevent @TraceId, 45, 1, 1
exec sp_trace_setevent @TraceId, 45, 6, 1-- start the trace exec sp\_trace\_setstatus @TraceId, 1 -- check status for our trace select value from fn\_trace\_getinfo(@TraceId) where property in (2, 5) go
and in C#
sb = new StringBuilder();
sb.AppendLine("\nEventClass: " + ts.GetString(ts.GetOrdinal("EventClass")));
sb.AppendLine("NTUserName: " + ts.GetString(ts.GetOrdinal("NTUserName")));
sb.AppendLine("Command : " + ts.GetString(ts.GetOrdinal("TextData"))); -
jojoba2011 wrote:
and trace everything in SQL but I cannot trace SP and ... that will call from C#.
I mean when i call SP in C# it doesnt trace.Not quite everything; stored procedures have their own trave_event, specifically SP:StmtStarting (44) and SP:StmtCompleted (45). A complete list of events can be found here[^].
Bastard Programmer from Hell :suss:
No ans for my Question!
-
No ans for my Question!
jojoba2011 wrote:
No ans for my Question
You do realize that we're volunteers here? I know that Sql-profiler can see the parameters, I assume that they're also there for a trace. I don't have an answer ready for this question.
Bastard Programmer from Hell :suss:
-
jojoba2011 wrote:
No ans for my Question
You do realize that we're volunteers here? I know that Sql-profiler can see the parameters, I assume that they're also there for a trace. I don't have an answer ready for this question.
Bastard Programmer from Hell :suss:
Here have a 5 for patience and being...
really an export in SQL
;)
-
Here have a 5 for patience and being...
really an export in SQL
;)