Stored Procedure and Cursor FAQ

Following are some of the common questions asked by DBAs about SQL Server stored procedures and cursors:

Q1: Do stored procedures really run faster than sending SQL statements directly to SQL Server?
A1: Yes, stored procedures run faster because they are precompiled, cached, and generate less network traffic.
Q2:When should I use stored procedures?
A2: Whenever you want to maximize performance and want to consolidate SQL code into a single program. Examples of stored procedure include INSERT, DELETE, and UPDATE stored procedures and reporting stored procedures.
Q3:When should I not use stored procedures?
A3: Stored procedures probably should not be used for ad-hoc querying because the parameters and the data being ...

Get Microsoft® SQL Server™ 2000 DBA Survival Guide, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.