Set ansi_nulls on
Go
Set quoted_identifier on
Go
-- ===================================================== ======
-- Author: <author, Name>
-- Create Date: <create date,>
-- Description: <description,>
-- ===================================================== ======
Create procedure <procedure_name, sysname, procedurename>
-- Add the parameters for the stored procedure here
<@ Param1, sysname, @ P1> <datatype_for_param1, int >=< default_value_for_param1, 0>,
<@ Param2, sysname, @ P2> <datatype_for_param2, int >=< default_value_for_param2, 0>
As
Begin
The Set xact_abort ON--SQL statement produces a runtime error and the entire transaction is terminated and rolled back
Begin tran -- start the transaction here
-- Set nocount on added to prevent extra result sets from
-- Interfering with select statements.
Set nocount on;
-- Insert statements for procedure here
Select <@ param1, sysname, @ P1>, <@ param2, sysname, @ P2>
Commit tran -- if no error occurs, submit the transaction directly.
End
Go