Save storeprocedure

USE [st_SubiTechnologies]
GO
/****** Object:  StoredProcedure [dbo].[Sp_Register_Save]    Script Date: 2/10/2017 10:46:56 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER PROCEDURE [dbo].[Sp_Register_Save]
@rowId int,
@Name varchar(300),
@Emailid varchar(300),
@PhoneNo varchar(20),
@LaptopBrand varchar(50),
@Model varchar(50),
@SerialNo varchar(200),
@Description varchar(700),
@DOE datetime,
@Coupon varchar(10),
@flag int output
AS
BEGIN
begin transaction

insert into [dbo].[tbl_registration](Name,Emailid,PhoneNo,LaptopBrand,Model,SerialNo,Description,DOE,Coupon)
values(@Name,@Emailid,@PhoneNo,@LaptopBrand,@Model,@SerialNo,@Description,@DOE,@Coupon)

if @@ERROR=0
begin
set @flag=1
commit transaction

end
else
begin
set @flag=0
rollback transaction
end
END

Popular posts from this blog

How to protect your Drive/Flash USB Drive (Pen Drive) with Password without using any software