Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

try catch sql

-- It is Transaction Control Language(TCL)
-- case1 (temporary)
BEGIN TRANSACTION
-- perform DML operation i.e. INSERT, UPDATE, DELETE
ROLLBACK -- goes to previous state 

-- case2 (permanent)
BEGIN TRANSACTION
-- perform DML operation i.e. INSERT, UPDATE, DELETE
COMMIT -- Transaction is executed and hence change is done permanently
 
PREVIOUS NEXT
Tagged: #catch #sql
ADD COMMENT
Topic
Name
1+6 =