Join Martin Guidry for an in-depth discussion in this video Exploring a real-world UPDATE procedure, part of SQL Server: Triggers, Stored Procedures, and Functions.
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 failure.…So I have a stored procedure staged that should accomplish all of this and…
- Comparing triggers, functions, and stored procedures
- Installing and configuring SQL Server
- Creating a stored procedure
- Returning data using data sets
- Creating user-defined functions
- Using "after," "instead," and nested triggers
- Modifying existing stored procedures
- Implementing logging on DELETE
- Choosing between T-SQL and CLR
- Executing a stored procedure
- Passing parameters
Skill Level Advanced
1. Getting Started
2. Installing SQL Server
Configuring your environment4m 53s
3. Stored Procedures
4. User-Defined Functions
6. Putting It All Together
7. Using CLR Assemblies
8. Exploring an ASP.NET Web Application
Next steps1m 43s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.