SQL Server RPC vs. SQL

  • Thread starter Thread starter Urs
  • Start date Start date
U

Urs

Hello,

With SQL Profiler I had a look to one of my ADO.net applications:
I have a lot of "RPC:Completed" and only some "SQL:BatchCompleted" statements.

What's the difference between them (I know: RPC stays for remote procedure call), but what's the point ADO.net (or anything else?)
desires to do the job as RPC instead of SQL?
Is there any diffence in the performance?
I also see a lot of "RPC:Completed, exec sp_reset_connection" statements. What's that? Has this a performace impact?

Thank you,
Urs
 
Hello,

"RPC:Completed" and "SQL:BatchCompleted" are trace events supported by SQL
server. Normally, "RPC:Completed" occurred when we call a SQL server store
procedure; "SQL:BatchCompleted" occurs when we execute come TSQL command
like "UPDATE...". Generally, they didn't make difference on performance.

The sp_reset_connection stored procedure is used by SQL Server to support
remote stored procedure calls in a transaction.

Hope this help,

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
Connection pooling uses sp_reset_connection to clean up any "state"
left behind by previous operations on the connection, like rowcount
values. I believe it also handles the situation where a USE database
command happens (the proc resets the database to the database
specified in the original connection string).

You can control this feature in the connection string to a
SqlConnection (the "Connection Reset" property, which defaults to
true). Be wary and test completely if you try to turn it off, it can
take care of many problems in reusing connections and the performance
impact is relatively small.
 
"RPC" vs "batch" is the TDS execution mode that ADO.NET (or any SQL Server
client) uses. When a plain SQL statement with no parameters is executed, we
use a "batch". When a stored-proc is executed, we use RPC (this is not the
same as RPC as the stand-alone network remote procedure call, we just happen
to call this mode RPC in TDS (the SQL Server network protocol)). Also, if
you execute a batch with parameter, we actually use a stored-proc called
sp_executesql, and pass the SQL statement itself and the rest of the
parameters to it, so it also shows up as RPC.

--
Pablo Castro
Program Manager - ADO.NET Team
Microsoft Corp.

This posting is provided "AS IS" with no warranties, and confers no rights.


Urs said:
Hello,

With SQL Profiler I had a look to one of my ADO.net applications:
I have a lot of "RPC:Completed" and only some "SQL:BatchCompleted" statements.

What's the difference between them (I know: RPC stays for remote procedure
call), but what's the point ADO.net (or anything else?)
desires to do the job as RPC instead of SQL?
Is there any diffence in the performance?
I also see a lot of "RPC:Completed, exec sp_reset_connection" statements.
What's that? Has this a performace impact?
 
Back
Top