|
Home > Archive > microsoft.public.sqlserver.server > June 2002 > Profiler - Cursors
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Profiler - Cursors
|
|
| SQL DBA 2002-06-28, 11:25 am |
| Hi,
I wanted to track the events that happen when cursor is
opened and run. I looked at the docs in BOL and created a
trace template in profiler by selecting all the event
classes under "Cursor".
Then I created a sample script which created and opened a
cursor over a very small table. The script worked fine,
however nothing shows up in the trace except an event
class "trace started". The script was run AFTER starting
the trace.
Am i doing something wrong ????
Thanks In Advance
| |
| Brian Moran 2002-06-28, 1:25 pm |
| It would help if you posted the script as well as the SQL Profiler trace
you're using. You can script a trace from the Script Trace menu from File on
the SQL Profiler GUI.
--
Brian Moran
SQL Server MVP
SQL Server Magazine Columnist
"SQL DBA" <jsingh87@hotmail.com> wrote in message
news:1387d01c21ec6$cedec8e0$39
ef2ecf@TKMSFTNGXA08...
> Hi,
>
> I wanted to track the events that happen when cursor is
> opened and run. I looked at the docs in BOL and created a
> trace template in profiler by selecting all the event
> classes under "Cursor".
>
> Then I created a sample script which created and opened a
> cursor over a very small table. The script worked fine,
> however nothing shows up in the trace except an event
> class "trace started". The script was run AFTER starting
> the trace.
>
> Am i doing something wrong ????
>
> Thanks In Advance
>
| |
| SQL DBA 2002-06-28, 3:25 pm |
| I could not trace the script, it produce a script file
with 0KB of data. But here is the script that I want to
test in the trace.
declare @site_ndx int
declare @manager_ndx int
declare @last_name nvarchar(30)
declare @first_name nvarchar(30)
declare test_cursor cursor
for
select *
from branch_manager
open test_cursor
fetch next from test_cursor into
@site_ndx,
@manager_ndx,
@last_name,
@first_name
while @@fetch_status <> -1
begin
select @site_ndx, @manager_ndx, @last_name,
@first_name
fetch next from test_cursor into
@site_ndx,
@manager_ndx,
@last_name,
@first_name
end
close test_cursor
deallocate test_cursor
>-----Original Message-----
>It would help if you posted the script as well as the SQL
Profiler trace
>you're using. You can script a trace from the Script
Trace menu from File on
>the SQL Profiler GUI.
>
>--
>
>Brian Moran
>SQL Server MVP
>SQL Server Magazine Columnist
>
>
>"SQL DBA" <jsingh87@hotmail.com> wrote in message
> news:1387d01c21ec6$cedec8e0$39
ef2ecf@TKMSFTNGXA08...
>> Hi,
>>
>> I wanted to track the events that happen when cursor is
>> opened and run. I looked at the docs in BOL and created
a
>> trace template in profiler by selecting all the event
>> classes under "Cursor".
>>
>> Then I created a sample script which created and opened
a
>> cursor over a very small table. The script worked fine,
>> however nothing shows up in the trace except an event
>> class "trace started". The script was run AFTER starting
>> the trace.
>>
>> Am i doing something wrong ????
>>
>> Thanks In Advance
>>
>
>
>.
>
|
|
|
|
|