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.. End
If
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:
Comments