From the course: Complete Guide to Advanced SQL Server

Unlock the full course today

Join today to access over 24,400 courses taught by industry experts.

Add error handling and test the system: Part 1

Add error handling and test the system: Part 1 - SQL Server Tutorial

From the course: Complete Guide to Advanced SQL Server

Add error handling and test the system: Part 1

The final step in our Game Scores database project is to test out some edge cases to make sure that the system functions as we intended, and to handle any error situations that we discover. So I'm going to start by just going with a known good scenario. We've run this kind of a query a couple of times now with this kind of insert. So we're just going to insert a single row into the score events table, and this will be to increment player ID number two's score by 125 points. So I'm going to insert that row into the table, and I get my three messages being generated by those triggers. So everything is working with this. I can select everything out of our three tables and we can see where we currently stand. So we have all of our score events here, including the new one that we just entered there for player number two, we have the current scores for each of our two players, and then we also have the new global score that was just updated with that insert. So we have a system that we know…

Contents