TRY ... Catch is an impressive new feature of SQL Server 2005/2008. Improved developer exception handling. There is no reason not to try. Catch function.
* TRY block-Contains code or script that may produce an exception* Catch Block-If an exception
Try catch in SQL The code is as follows:Copy code BEGIN TRANSACTIONBEGIN TRY-- YOUR SQLCOMMITEND TRYBEGIN CATCHROLLBACKEND CATCH The above code is executed in SQL SERVER 2008.After try catch is used, the CATCH will be rolled back if an
A. Syntax Essentials:BEGIN TRY{sql_statement | statement_block}END TRYBEGIN CATCH[{sql_statement | statement_block}]END CATCH[ ; ] Exception section:within the scope of a catch block, you can use the following system functions to get the error
1.try Catch Personal understandingA try catch is a block of statements that SQL uses for error handling, and when we write SQL statements (usually when we write more complex stored procedures), using try catch appropriately captures the error
Today, I checked the project sample code. I also wrote the try-catch code block in the stored procedure. I thought it was fresh. I don't know if it was the new syntax of SQL 2005 (I used to use 2000). The Code is as follows:
Create proc [dbo].
Directory
1. Programming with the Transact-SQL language
1.1. Data Definition Language DDL
1.2. Data manipulation language DML
1.3. Data Control Language DCL
1.4.transact-sql Language Basics
2.
SQL Server 2008 is the most commonly used SQL database on Windows, and the 2008 installation mechanism is based on the framework rewrite, which is very time-consuming (my laptop configuration is OK.) ^_^). But do not need the original ISO or hidden
In the development of database application project, some binary image data are often used, and the data of storing and reading the display image mainly adopts path link method and memory flow method. The path link method is to save the image file in
1. Download the JDBC driver package from Microsoft Official websiteSqljdbc_4.0.2206.100_chs.exe, double-click Unzip file to the specified directory, my specified directory is:C:\Program Files\Microsoft JDBC Driver 4.0 for SQL
Recently, due to reinstall the system, in the installation of various software, the decision to use a blog to record, so that they can view later, also for others reference.Disclaimer: This blog is not originalUsing SQL Server 2008 databases in
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.