Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 sql profiler play back a part of script

Author  Topic 

TRACEYSQL
Aged Yak Warrior

594 Posts

Posted - 2008-07-13 : 13:08:41
I have put the profiler on and capture some commands...Now i like to copy this and replay in sql query but i don't understand how to do this.

declare @p1 int
set @p1=1073741879
declare @p2 int
set @p2=180150097
declare @p5 int
set @p5=8
declare @p6 int
set @p6=1
declare @p7 int
set @p7=1
exec sp_cursorprepexec @p1 output,@p2 output,N'@P1 varchar(6),@P2 varchar(10),@P3 varchar(2),
@P4 varchar(10)',N'SELECT S.ORG_SEC_PROF_CD, P.PROF_ORG_SEC_FL
FROM ORG_SEC_GRP_SETUP S, DELTEK.ORG_SEC_PROFILE P WHERE
S.ORG_SEC_GRP_CD = @P1
AND S.ORG_SEC_PROF_CD = P.ORG_SEC_PROF_CD AND S.COMPANY_ID = @P2
AND S.S_MODULE_CD = @P3
AND P.COMPANY_ID = @P4
',@p5 output,@p6 output,@p7 output,'BUSSOL','1','AO','1'
select @p1, @p2, @p5, @p6, @p7

Now i want to copy this and just run in SQL Query

How do i get the parameters for the @p1 WHICH give me
1073741879 and this is not the value for ORG_SEC_GRP_CD the value is the BUSSOL

I just want to do
select part where value = 'BUSS0L' etc but having hard job getting
the values out.

Any explaination of how to rerun back on the SQL Query for further investigation.

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-07-13 : 16:47:40
Which events did you trace? The statement maybe from sp or so, and @p1 can't be string since it's int type.
Go to Top of Page

TRACEYSQL
Aged Yak Warrior

594 Posts

Posted - 2008-07-13 : 20:49:16
Using standard trace profiler.
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-07-13 : 22:29:26
Not sure what you mean standard trace profiler. How did you choose events to trace in profiler?
Go to Top of Page
   

- Advertisement -