17.07.2015 Views

Defensive Database Programming - Red Gate Software

Defensive Database Programming - Red Gate Software

Defensive Database Programming - Red Gate Software

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 7: Advanced Use of Constraints'Active') ;INSERT INTO dbo.Tickets( TicketID ,AssignedToDeveloperID ,Description ,TicketStatus ,DeveloperStatus)VALUES ( 1 ,1 ,'Cannot print TPS report' ,'Active' ,'Active') ;INSERT INTO dbo.Tickets( TicketID ,AssignedToDeveloperID ,Description ,TicketStatus ,DeveloperStatus)VALUES ( 2 ,1 ,'TPS report for June hangs' ,'Closed' ,NULL) ;Listing 7-16: Repopulating Developers and Tickets tables.If we rerun Listing 7-11, it will raise an error, confirming that Justin cannot go onvacation, because there is an active ticket assigned to him224

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!