Click here to Skip to main content
15,902,114 members
Home / Discussions / Database
   

Database

 
GeneralRe: Read LFD(log ) file SQLserver 2008 Pin
Eddy Vluggen8-May-12 0:17
professionalEddy Vluggen8-May-12 0:17 
QuestionRe: Read LFD(log ) file SQLserver 2008 Pin
jojoba20119-May-12 17:52
jojoba20119-May-12 17:52 
AnswerRe: Read LFD(log ) file SQLserver 2008 Pin
Eddy Vluggen10-May-12 0:07
professionalEddy Vluggen10-May-12 0:07 
QuestionRe: Read LFD(log ) file SQLserver 2008 Pin
jojoba201111-May-12 17:28
jojoba201111-May-12 17:28 
AnswerRe: Read LFD(log ) file SQLserver 2008 Pin
Eddy Vluggen12-May-12 0:45
professionalEddy Vluggen12-May-12 0:45 
QuestionRe: Read LFD(log ) file SQLserver 2008 Pin
jojoba201112-May-12 22:31
jojoba201112-May-12 22:31 
AnswerRe: Read LFD(log ) file SQLserver 2008 Pin
Eddy Vluggen13-May-12 4:08
professionalEddy Vluggen13-May-12 4:08 
QuestionRe: Read LFD(log ) file SQLserver 2008 Pin
jojoba201113-May-12 19:22
jojoba201113-May-12 19:22 
thanks a lot <big>Eddy Vluggen.</big>
Your really an export in SQL.


I have use this for SP:
SQL
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#
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")));



I have done about 90 percent:

but when i run any SP in SQL Management it returns exactly the SP witch have exec in LOG like bellow :

SQL
INSERT INTO tblGroups
                      (GroupName, GroupFatherId)
VALUES     ('Friends',1)


OR
SQL
DECLARE	@return_value int

EXEC	@return_value = [dbo].[InsertGroups]
		@GroupName = N'ali joon',
		@GroupFatherId = 1

SELECT	'Return Value' = @return_value



But when i run SP in C# it only return the <big>SP Code</big>.like bellow:
SQL
INSERT INTO tblGroups
                      (GroupName, GroupFatherId)
VALUES     (@GroupName,@GroupFatherId)


<big>But i wanna to have this also :</big>

SQL
INSERT INTO tblGroups
                      (GroupName, GroupFatherId)
VALUES     ('Friends',1)


OR

SQL
DECLARE	@return_value int

EXEC	@return_value = [dbo].[InsertGroups]
		@GroupName = N'ali joon',
		@GroupFatherId = 1

SELECT	'Return Value' = @return_value


modified 14-May-12 3:51am.

QuestionRe: Read LFD(log ) file SQLserver 2008 Pin
jojoba201115-May-12 5:11
jojoba201115-May-12 5:11 
AnswerRe: Read LFD(log ) file SQLserver 2008 Pin
Eddy Vluggen16-May-12 2:06
professionalEddy Vluggen16-May-12 2:06 
GeneralRe: Read LFD(log ) file SQLserver 2008 Pin
JohnPayton22-May-12 19:18
JohnPayton22-May-12 19:18 
GeneralRe: Read LFD(log ) file SQLserver 2008 Pin
Eddy Vluggen23-May-12 0:13
professionalEddy Vluggen23-May-12 0:13 
QuestionSee If Stored Proc Returns Data Pin
Kevin Marois3-May-12 10:51
professionalKevin Marois3-May-12 10:51 
AnswerRe: See If Stored Proc Returns Data Pin
Mycroft Holmes3-May-12 12:40
professionalMycroft Holmes3-May-12 12:40 
AnswerRe: See If Stored Proc Returns Data Pin
Eddy Vluggen4-May-12 0:01
professionalEddy Vluggen4-May-12 0:01 
AnswerRe: See If Stored Proc Returns Data Pin
Corporal Agarn7-May-12 7:21
professionalCorporal Agarn7-May-12 7:21 
AnswerRe: See If Stored Proc Returns Data Pin
vvashishta10-May-12 4:46
vvashishta10-May-12 4:46 
QuestionPlaying music on my end, with APIs of search engines Pin
Neha.prakash882-May-12 21:52
Neha.prakash882-May-12 21:52 
AnswerRe: Playing music on my end, with APIs of search engines Pin
Richard MacCutchan2-May-12 22:24
mveRichard MacCutchan2-May-12 22:24 
AnswerRe: Playing music on my end, with APIs of search engines Pin
Eddy Vluggen4-May-12 0:04
professionalEddy Vluggen4-May-12 0:04 
GeneralRe: Playing music on my end, with APIs of search engines Pin
Neha.prakash884-May-12 0:19
Neha.prakash884-May-12 0:19 
SuggestionRe: Playing music on my end, with APIs of search engines Pin
Eddy Vluggen4-May-12 0:26
professionalEddy Vluggen4-May-12 0:26 
GeneralRe: Playing music on my end, with APIs of search engines Pin
Neha.prakash884-May-12 0:29
Neha.prakash884-May-12 0:29 
GeneralRe: Playing music on my end, with APIs of search engines Pin
Eddy Vluggen4-May-12 0:39
professionalEddy Vluggen4-May-12 0:39 
Questioncheck date range in between date range Pin
RA|-|UL PATEL2-May-12 20:58
RA|-|UL PATEL2-May-12 20:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.