Day 15. Day Writing and Executing Stored Procedures

Today, you are going to learn how to write and manage stored procedures and how the server uses them. Stored procedures are nothing more than T-SQL statements that have been saved within the database and can be executed by referencing the name with which it was saved. To see this, some of the topics that are covered in today's lesson are

  • Understanding stored procedures

  • Writing your first stored procedure

  • Working with parameters

  • Returning procedure status

After learning the basics of stored procedures in this lesson, you will then learn some of the more advanced issues of stored procedures in tomorrow's lesson.

Stored procedures are batches of T-SQL statements that SQL Server stores in the database and then executes by name. They provide a number of benefits, including enhanced control of data, straightforward access to complex data operations, and improved performance. In some applications, a database administrator (or DBA) might decide that procedures should be the only interface to the data.

A stored procedure should contain a logical set of commands that are executed more than once for that database. They enable the SQL programmer to simply call the stored procedure as a function instead of repeatedly executing the same statements inside a SQL script. However, stored procedures have additional advantages.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset