?
Solved

SQL Profiler-Duplicate events for same stored procedure

Posted on 2011-09-17
2
Medium Priority
?
342 Views
Last Modified: 2012-05-12
Hello,

I ran sql profiler with Template as "TSQL_Duration" for a stored procedure(A) which inturn calls couple of other stored procedures(B,C,D) from within it.
I see Two RPC:Completed event for the same stored procedure(D) in sql profiler.

Why does this happen?
First RPC:Completed event for stored procedure (D) takes 47 ms and
the second RPC:COMPLETED event for the same stored procedure (D) takes 40 ms.

So should I add those up and take that as the total duration for that stored procedure D (or) do an average of it?

Thanks.
0
Comment
Question by:sath350163
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Accepted Solution

by:
25112 earned 1000 total points
ID: 36562733
firstly check if both have same SPID and same timeframe.. (possible double execution)?

what about A,B & C- did they all complete only once?
0
 

Author Comment

by:sath350163
ID: 36922011
Yes, you are right.
The same stored procedure is being invoked twice.

Thanks for bringing up this point.
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Suggested Courses

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question