Library sample chapters

Stored Procedures

Introduction

This is a sample chapter from Beginning Visual Basic SQL Server 7

In Chapter 5 we used SQL statements to insert, select, update, and delete data, and in the last chapter we used SQL statements to select data from the State_T table. While the use of in-line SQL statements is great for ad-hoc queries, they are not generally used in production applications. They do, however, have their place in production applications where dynamic SQL statements are to be built and executed. Dynamic SQL statements are SQL statements that are built in your VB code, thus they are generated dynamically at run-time. You typically use If.. Else.. EndIf statements to build the SQL statements needed to retrieve the data that the user has requested. For the most part stored procedures are used, and provide many benefits over in-line Transact-SQL statements.

This chapter explores stored procedures and demonstrates some of the basic tasks that can be accomplished with them. We will take a look at stored procedure parameters and see how they can be used to build robust stored procedures. All of the stored procedures created in this chapter will be executed in a VB front-end program that we will create.

In this chapter we will examine:

  • Stored procedure performance
  • Input and output parameters and the return value
  • Stored procedures that select, insert, update, and delete data
  • Comments

    1. 03 Jun 2005 at 10:53

      Hi there!


      What is meant by this: 3.    Don't forget to set a reference to the Microsoft ActiveX Data Objects Library in your project?


      Thanks ALOT!

    2. 08 Jun 2004 at 19:34

      As a new user to the the vb.net, I am curious to know how things work. But when I try some codes written in the book " Beginning Visual Basic .NET Database Programming", I am stuck in a few places.


      Firstly, the instruction said "Change the Modifiers property from Assembly to Family." which i cannot find either Assembly or Family in the Properties. So I change Modifier - Friend (assuming that's what the author refer to as assembly) to Public (assuming it's the other word for Family).


      Secondly, during creating stored procedures, I only can see Refresh and Properties when trying to create New Stored Procedures.


      please advice

    3. 01 Jan 1999 at 00:00

      This thread is for discussions of Stored Procedures.

    Leave a comment

    Sign in or Join us (it's free).

    We'd love to hear what you think! Submit ideas or give us feedback