Transact-SQL (T-SQL) statements can be grouped and executed together in a variety of ways. They can be
Compiled as a part of a stored procedure, user-defined function, or trigger
Written and executed individually or in groups from client utilities in the form of batches
Grouped and stored in external script files that can be opened and executed from various client utilities
Grouped in transactions that succeed completely or fail completely
This chapter discusses batches, scripts, and transactions.
It is not necessary to run examples from the text against the Asset5 database, but if you do, you must first make sure that the database contains the following table by executing the following script against the Asset5 database:
Create Table Part(PartId int identity, Make varchar(50), Model varchar(50), Type varchar(50}}
This table is used to illustrate the concepts discussed in this chapter. Some of the changes are destructive, so existing tables such as Equipment will not be used, which may be needed for other purposes later.