December 2001
Intermediate to advanced
800 pages
17h 55m
English
Certain Transact-SQL commands affect the order in which statements are executed in a stored procedure or command batch. These are referred to as flow control or control-of-flow statements because they control the flow of Transact-SQL code execution. Transact-SQL flow control language statements include IF…ELSE, WHILE, GOTO, RETURN, WAITFOR, BREAK, CONTINUE, and BEGIN…END. We'll discuss the various flow control commands further in the book, but for now here's a simple procedure that illustrates all of them (Listing 1-30):
USE pubs IF OBJECT_ID('dbo.listsales') IS NOT NULL DROP PROC dbo.listsales GO CREATE PROC dbo.listsales @title_id tid=NULL AS IF (@title_id='/?') ... |
Read now
Unlock full access