Explore a real-world UPDATE procedure SQL Server


show more Exploring a real-world UPDATE procedure provides you with in-depth training on Business. Taught by Martin Guidry as part of the SQL Server: Triggers, Stored Procedures, and Functions show less
please wait ...

Exploring a real-world UPDATE procedure

Next I'd like to talk about a real-world UPDATE stored procedure. On this one we're going to work with a slightly different set of business rules. Now in the real-world your insert and UPDATE stored procedure would likely have the same set of rules. I am going to go with a different set of business rules just for the sake of having more things to demo. So our update rules are you can not subscribe to the newsletter if your email address is null. This makes sense because our newsletter is an email newsletter. So you can't subscribe if you don't have an email address. The update stored procedure should not be allowed to change the ID.

It can change any other piece of data, but it cannot change someone's ID. It needs to return an error if the ID does not exist. If someone attempts to modify student 1234 but student 1234 does not exist in the database, we need to let them know about that problem, and then we have my general best practice return 1 for success and 0 for fail...

Exploring a real-world UPDATE procedure
Video duration: 3m 13s 1h 52m Advanced

Viewers:

Exploring a real-world UPDATE procedure provides you with in-depth training on Business. Taught by Martin Guidry as part of the SQL Server: Triggers, Stored Procedures, and Functions

Subjects:
Business Developer IT
Software:
SQL Server
Author:
please wait ...