New functions to use with try-catch

I'm still assimilating little tidbits of information about the Nov-Dec CTP build. Put this one in your pubs database in the CTP:

create procedure deletejob (@id int)
begin try
 delete jobs where job_id = @id
end try
begin catch
 — you knew about these
 print error_number()
 print error_message()
 print error_severity()
 print error_state()
 — these are undoc'd but work in the CTP
 print error_line()           — line number
 print error_procedure()  — procedure name
end catch

execute deletejob 2

Other articles

Imagine feeling confident enough to handle whatever your database throws at you.

With training and consulting from SQLskills, you’ll be able to solve big problems, elevate your team’s capacity, and take control of your data career.