课程: Program Databases with Transact-SQL
今天就学习课程吧!
今天就开通帐号,24,100 门业界名师课程任您挑!
Challenge: Add error handling to a stored procedure - SQL Server教程
课程: Program Databases with Transact-SQL
Challenge: Add error handling to a stored procedure
(upbeat electronic music) - [Instructor] For the last challenge of this course, I'd like you to return to the stored procedure that was developed at the end of the previous chapter. If you remember, we created a procedure that contained a transaction that would help transfer money from one bank account to another. Now it's time to add some error handling to the procedure. You can either continue developing your own procedure or use the 05_06_Challenge-Start.sql file to pick up with a solution that I came up with. The goal of the challenge is to gracefully handle three different situations. First, make sure that the account that the money is coming from won't fall below a zero balance. We don't want to allow anyone to overdraft their account. Second, make sure that the money is coming from an account that actually exists. And third, it's probably a good idea that the account the money is going into also exists. Only complete the transfer once all three of these conditions are met. I…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。
内容
-
-
-
-
-
-
-
(已锁定)
What is error handling?1 分钟 52 秒
-
(已锁定)
Capture errors with TRY and CATCH4 分钟 54 秒
-
(已锁定)
Generate errors with THROW4 分钟 12 秒
-
(已锁定)
Manage transaction control4 分钟 4 秒
-
(已锁定)
Challenge: Add error handling to a stored procedure1 分钟 12 秒
-
(已锁定)
Solution: Add error handling to a stored procedure12 分钟 12 秒
-
(已锁定)
-
-