ストアドプロシージャとトランザクションは初めてです。
2つのテーブルにデータを挿入するストアドプロシージャを作成しました。これがSPです:
Begin
SET NOCOUNT ON
Declare @Parcel_Id int
INSERT INTO
Parcel([Code],[Title],
[Is_Parcel_Equal_To_Property],
[Property_Id],[Property_Type_Id],
[Plot_No],[Phone],[Fax],[Email],
[Administrator_Name],
[Watchman_Name],
[Remark],
[List_in_Retail_Leasing_Module],
[Landlord_Id],
[Country_Id],[State_Id],[Community_Id],[MainRoad_Id],
[Address],
[Is_Active],
[Added_On_Date],[Added_By])
VALUES(@Code,@Title,
@Is_Parcel_Equal_To_Property,
@Property_Id,@Property_Type_Id,
@Plot_No,@Phone,@Fax,@Email,
@Administrator_Name,
@Watchman_Name,
@Remark,
@List_in_Retail_Leasing_Module,
@Landlord_Id,
@Country_Id,@State_Id,@Community_Id,@MainRoad_Id,
@Address,
@Is_Active,
@Added_On_Date,@Added_By)
Set @Parcel_Id = SCOPE_IDENTITY()
INSERT INTO Parcel_Spacifications
([Parcel_Id],[Apartments],[Villas],[Retails],[Offices],[Labour_Camp],
[Warehouses],[Total_Car_Parks],[Floors],[Year_Of_Construction],
[Built_Up_Area],[Plot_Area],[No_Of_Basements],[Is_Special_Project])
VALUES (@Parcel_Id,@Apartments,@Villas,@Retails,@Offices,@Labour_Camp,
@Warehouses,@Total_Car_Parks,@Floors,@Year_Of_Construction,
@Built_Up_Area,@Plot_Area,@No_Of_Basements,@Is_Special_Project)
End
RETURN @Parcel_Id
今、私はトランザクションを使いたいのですが、どうすればいいですか?