The Gurus Guide to SQL Server Stored Procedures, XML, and HTML [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

The Gurus Guide to SQL Server Stored Procedures, XML, and HTML [Electronic resources] - نسخه متنی

Ken Henderson

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید








Chapter 7. Error Handling



Great designers aren't afraid of complexity, and some of the best are drawn to it. But their goal is to make the seemingly complex simple.

Steve McConnell[1]

[1] McConnell, Steve. After the Gold Rush. Redmond, WA: Microsoft Press, 1999. Page 26.



In this chapter we'll talk about the conventional ways of raising and handling errors in stored procedures, as well as some of the quirks you may run into with Transact-SQL error management. Transact-SQL's error-handling facilities work reasonably well, but they don't always work in the most logical fashion or as consistently as we might like. Even if you're careful to add error-handling code to every stored procedure on your server, you can't rely on it to work 100% of the time, even for low-severity errors. You must implement robust error handling in your client applications to complement the error handling in your Transact-SQL code. Microsoft has publicly announced that in the next version of SQL Server (code named Yukon), Transact-SQL will have structured exception-handling syntax built in. When this happens, you'll have better control over errors and unexpected conditions in your code. Until then, you may have to jump through a few hoops to get the error handling in your applications just right. That's what this chapter is aboutshowing you where the pitfalls are and giving you advice on how to avoid them.

/ 223