Database Reference
In-Depth Information
Figure 7.20
Test trigger KeepIntegrity.
JOIN, only classes with students will be selected. As shown in Figure 7.20, no row is deleted from
STUDENT_CLASS since each class has at least one student.
ACTIVITY 7.1 FUNCTIONS, STORED PROCEDURES, AND TRIGGERS
Transact-SQL provided by Windows Azure SQL Database has some procedural program-
ming components such as variables, user-deined functions, and low-control structures. he
following lab activity will show you how to create and use functions, procedures, and triggers.
TASK 1: CONNECT TO WINDOWS AZURE SQL DATABASE
Use the following steps to open the Windows Azure SQL Database Management Portal:
1. On your local computer, log on to Windows Azure through the URL:
https:// yourserver .database.windows.net
where yourserver is your SQL Database server name.
2. Enter the database name Class_Registration . hen, enter your user name and pass-
word to log on to Windows Azure SQL Database.
3. Once you have logged on, click the New Query icon at the upper-left corner of your
screen.
TASK 2: USER-DEFINED TABLE FUNCTIONS
here are two types of table-valued functions, inline function and multistatement func-
tion . he following steps demonstrate how to create a multistatement function:
1. To illustrate the use of multistatement function, consider the case where, for a given
student, we irst insert the student's information such as the student id, last name,
Search WWH ::




Custom Search