Benefits of Using Stored Procedures

Usually, stored procedures are used to encapsulate or enforce business rules in your databases. For example, if you have to do some calculations before inserting data in a table, you can embed this logic in a stored procedure and then insert the data using this stored procedure. Similarly, if you don't want users to directly access tables and any other objects, you can create stored procedures to access these objects and have users use them, instead of manipulating objects directly. For example, Microsoft discourages users from making direct modifications to system tables; however, SQL Server comes with system stored procedures to manipulate system tables.

Caution

If you develop applications that modify system ...

Get Microsoft® SQL Server™ 2000 Programming by Example 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.