Stored Procedures

Summary

As we wrap things up in this chapter you should feel pretty good about your data entry program. Not only have you coded a program that uses stored procedures and performs all types of data entry, but you have also encapsulated all of the basic functionality into one class. This class can be used by other programs and server components, or can even be made into a server component by itself. We will be using this class in other examples later in the book.

We have taken a look at stored procedure performance and user prefixes. We now know why we should use stored procedures versus in-line SQL statements, and why we should always prefix our stored procedures with the user prefix.

We have also explored the basic SELECT, INSERT, UPDATE, and DELETE stored procedures and have used them in our program. You should feel comfortable using stored procedures and passing parameters to them. You should also understand the difference between stored procedure input and output parameters and return values.

In summary, you should know:

  • The different parameters of a stored procedure
  • How to process the data in an output parameter returned from a stored procedure
  • How to process a return value returned from a stored procedure
  • How to create stored procedures and code stored procedure parameters
  • How to execute stored procedures in your VB programs
  • Why and how to set permissions on your stored procedures
  • In the next chapter we will take a closer look at the benefits of stored procedures over in-line SQL statements, and consider some ways to optimize both.

    You might also like...

    Comments

    Contribute

    Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

    Our tools

    We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

    “Beware of bugs in the above code; I have only proved it correct, not tried it.” - Donald Knuth