Join Martin Guidry for an in-depth discussion in this video Using transactions, part of SQL Server: Triggers, Stored Procedures, and Functions.
Database developers can and should use transactions, to provide a logical…grouping of actions.…Transactions can happen inside of a stored procedure or outside of the stored procedure.…I typically do most of my transactions inside of stored procedures.…And we'll talk a few reasons about why.…I have on the screen some code you can get from the exercise files.…It's a basic stored procedure, that's going to either delete or deactivate an author.…There's one UPDATE statement that runs on line 6, 7 and 8.…That's going to set the particular author's active status to 0, meaning he is inactive.…
And then lines 10, 11 and 12, set his phone number equal to Null.…So this is a hypothetical where we want to stop tracking personal information…about people that are no longer active.…Lines 14 to 17, allow us to potentially roll- back the transaction if there's a problem.…So this will help us avoid the situation, where we might end up with an author…who we couldn't mark as inactive.…We don't want to still remove his phone number.…
- 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.