From the course: Complete Guide to Advanced SQL Server
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Add error handling and test the system: Part 2 - SQL Server Tutorial
From the course: Complete Guide to Advanced SQL Server
Add error handling and test the system: Part 2
We scroll down here and take a look at our last test that I have, and that's to test it with an invalid player ID. So this one's a little bit interesting. Insert into game-score events. So we'll try and enter a player ID and a score. But this time instead of entering a score for player 1 or 2, let's try and enter a score for a player number five, which I know is not present in the database. At least it's not present in the players table. But if I try and insert this into the score events table, there's nothing really preventing me right now from doing that. So it tells me that the current global score has been recorded, score events have been recorded, player total score has been updated. So it went through all of my triggers, but I now have an invalid row in my table. We select all three tables again, see what happened. So we've got that new entry in the events table. So player number five scored 99 points. But if we look in the players table, there actually is no player number five.…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
GameScore database final project setup2m 38s
-
(Locked)
Create a trigger to add points to player records6m 30s
-
(Locked)
Calculate global score with custom function4m 7s
-
(Locked)
Write a stored procedure: Part 16m 19s
-
(Locked)
Write a stored procedure: Part 24m 44s
-
(Locked)
Add error handling and test the system: Part 16m 14s
-
(Locked)
Add error handling and test the system: Part 25m 52s
-
-