Showing posts with label profiler. Show all posts
Showing posts with label profiler. Show all posts

Wednesday, March 28, 2012

Running a stored procedure in Query Analyzer vs ADO - Execution Di

I am running SQL Server 2000 SP3. I have a stored procedure that I call from
a VB 6.0 Component using ADO/OLEDB. I turn on SQL profiler and see that the
stored proc executes in 22 seconds. I take the stored procedure call straight
out of profiler and paste it into SQL Query Analyzer and run the stored
procedure. It executes in Query Analyzer in 4 seconds. When I look at the
execution plan, Query Analyzer uses a different plan (more efficient) than
the plan used when the stored procedure is executed through ADO. How is this
possible? What am I doing wrong with ADO? How come the stored procedure will
not execute in 4 seconds when I call it through ADO? I can consistently
duplicate this.
Todd.Danner@.wachovia.com wrote:
> I am running SQL Server 2000 SP3. I have a stored procedure that I
> call from a VB 6.0 Component using ADO/OLEDB. I turn on SQL profiler
> and see that the stored proc executes in 22 seconds. I take the
> stored procedure call straight out of profiler and paste it into SQL
> Query Analyzer and run the stored procedure. It executes in Query
> Analyzer in 4 seconds. When I look at the execution plan, Query
> Analyzer uses a different plan (more efficient) than the plan used
> when the stored procedure is executed through ADO. How is this
> possible? What am I doing wrong with ADO? How come the stored
> procedure will not execute in 4 seconds when I call it through ADO? I
> can consistently duplicate this.
How are you executing the procedure from ADO? Post the code you are
testing on ADO (all relevant code) and the SQL you use in QA..
David G.

Running a stored procedure in Query Analyzer vs ADO - Execution Di

I am running SQL Server 2000 SP3. I have a stored procedure that I call from
a VB 6.0 Component using ADO/OLEDB. I turn on SQL profiler and see that the
stored proc executes in 22 seconds. I take the stored procedure call straigh
t
out of profiler and paste it into SQL Query Analyzer and run the stored
procedure. It executes in Query Analyzer in 4 seconds. When I look at the
execution plan, Query Analyzer uses a different plan (more efficient) than
the plan used when the stored procedure is executed through ADO. How is this
possible? What am I doing wrong with ADO? How come the stored procedure will
not execute in 4 seconds when I call it through ADO? I can consistently
duplicate this.Todd.Danner@.wachovia.com wrote:
> I am running SQL Server 2000 SP3. I have a stored procedure that I
> call from a VB 6.0 Component using ADO/OLEDB. I turn on SQL profiler
> and see that the stored proc executes in 22 seconds. I take the
> stored procedure call straight out of profiler and paste it into SQL
> Query Analyzer and run the stored procedure. It executes in Query
> Analyzer in 4 seconds. When I look at the execution plan, Query
> Analyzer uses a different plan (more efficient) than the plan used
> when the stored procedure is executed through ADO. How is this
> possible? What am I doing wrong with ADO? How come the stored
> procedure will not execute in 4 seconds when I call it through ADO? I
> can consistently duplicate this.
How are you executing the procedure from ADO? Post the code you are
testing on ADO (all relevant code) and the SQL you use in QA..
David G.

Tuesday, March 20, 2012

RUN SQL Profiler with non sysadmin role in SQL Server 2000

Hi,

Is it possible to RUN SQL Profiler with non sysadmin role in SQL Server 2000?
Is it possible to include the GRANT ALTER TRACE function to SQL Server 2000?
David Chai
davidch@.avanade.com

Hi David,

It's NOT possible to use SQL profiler with non-admin role in SQL Server2000, NOR can you use "Grant Alter Trace" to grant a non-admin an access to run profiler in SQLServer 2000.

This feature is new in SQLServer 2005.

Please let me know if you have any questions.

thanks,

Allen

RUN SQL Profiler with non sysadmin role in SQL Server 2000

Hi,

Is it possible to RUN SQL Profiler with non sysadmin role in SQL Server 2000?
Is it possible to include the GRANT ALTER TRACE function to SQL Server 2000?
David Chai
davidch@.avanade.com

Hi David,

It's NOT possible to use SQL profiler with non-admin role in SQL Server2000, NOR can you use "Grant Alter Trace" to grant a non-admin an access to run profiler in SQLServer 2000.

This feature is new in SQLServer 2005.

Please let me know if you have any questions.

thanks,

Allen

Monday, March 12, 2012

run profiler when high cpu

I want to have profiler run for a period of time - 5 minutes - when system
cpu exceeds 90%. This would happen automatically. Can this be done?
My suggestion would be to add an alert to Performance Monitor to detect the
> 90% CPU, and then have it execute 'the relevant SQL' to start a
server-side profile. See
http://vyaskn.tripod.com/server_side_tracing_in_sql_server.htm for the
latter. The '5 minutes' would just be a case of storing the trace start
time somewhere, and having a SQL job that runs intermittently that stops the
trace after the required time.
"nickI" <nickI@.discussions.microsoft.com> wrote in message
news:184E59AD-FE7A-40FB-9783-BAAA17BF0348@.microsoft.com...
>I want to have profiler run for a period of time - 5 minutes - when system
> cpu exceeds 90%. This would happen automatically. Can this be done?