2 Using the Data Providers : Using Stored Procedures

Using Stored Procedures
If your application executes the same SQL statements multiple times, performance can be improved by creating a stored procedure on the server at prepare time. If your application executes one of these prepared statements multiple times, performance improves because the data provider created a stored procedure and executing a stored procedure is faster than executing a single SQL statement; however, if a prepared statement is only executed once or is never executed, performance can decrease.
You can execute stored procedures in an application using the ADO.NET convention or by using ODBC escape sequences. Using the ADO.NET convention generally provides some performance benefits, because less overhead is required. The data provider is aware that it is processing a stored procedure, and does not have to parse the string to determine its contents.
To enable stored procedures in an application using the approach built into ADO.NET:
Alternatively, you can enable stored procedures using ODBC escapes:
CommandText={call myproc(?,?,?)}
See the "Using Stored Procedures" section in the data provider chapters for more information.
To further enhance the performance benefits, you can enable statement caching. The data provider manages a cache of prepared statements to allow statements to be reused in subsequent application requests for similar statements. See “Using Statement Caching” for more information.
NOTE FOR ADO.NET ENTITY FRAMEWORK USERS:
The Connection object includes properties and methods that provide reauthentication and enhanced statistics functionality. The methods and properties are standard in the ADO.NET data provider, but are not available at the ADO.NET Entity Framework layer. Instead, you expose the same functionality through "pseudo" stored procedures.
This approach uses the Entity Data Model (EDM) to achieve results that correspond to the ADO.NET results. This in effect provides entities and functions backed by pseudo stored procedures.
For more information, see the chapter for your Entity Framework data provider.