Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

How to add a Try/Catch to SQL Stored Procedure

 CREATE PROCEDURE [dbo].[PL_GEN_PROVN_NO1]        
       @GAD_COMP_CODE  VARCHAR(2) =NULL, 
       @@voucher_no numeric =null output 
       AS         
   BEGIN  

     begin try 
         -- your proc code
     end try

     begin catch
          -- what you want to do in catch
     end catch    
  END -- proc end
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #How #add #SQL #Stored #Procedure
ADD COMMENT
Topic
Name
5+7 =