J
Jack Jackson
No. The SQL text will be passed to SQL Server, which will execute it on the
server, and return the selected records. Using stored procedures is fine, but
the performance difference is quite small in most cases.
Some people prefer SELECT statements and others prefer stored
procedures.
If you repeatedly execute the same SELECT statement changing only
values in the WHERE clause, then I think you get better performance by
using parameters for the values as that lets SQL Server cache the
execution plan of the SELECT.
I usually use SELECT statements rather than stored procedures. When I
have to make changes to the code as well as the SELECT statement, I
only have to change the app, instead of changing both the app and the
stored procedure. It also reduces the chance of the app and the
stored procedure not matching due to an app being updated but the
database not updated, or the reverse.
I use stored procedures for complex procedures that need to use
temporary tables and cursors, complex queries that are used in
multiple places, and for queries that are changeable by the end user.