Vikas

Vikas

  • NA
  • 831
  • 196k

How to Duplicate Email Id block from Database

Jun 12 2018 8:30 AM
CREATE PROCEDURE [dbo].[sp_user_master_add]
@Email NVARCHAR(100),
@Password NVARCHAR(100),
@Name NVARCHAR(250),
@Company_Name NVARCHAR(500),
@Address1 NVARCHAR(1000),
@Address2 NVARCHAR(1000),
@City NVARCHAR(150),
@State NVARCHAR(150),
@Pincode INT,
@Mobile NVARCHAR(15),
@key NVARCHAR(150),
@Return_Value INT OUTPUT
AS
SET @Return_Value = 0
BEGIN TRAN
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure here
INSERT INTO
tbl_user_master
(
Email,
[Password],
Name,
Company_Name,
Address1,
Address2,
City,
[State],
Pincode,
Mobile,
[key]
)
VALUES
(
@Email,
@Password,
@Name,
@Company_Name,
@Address1,
@Address2,
@City,
@State,
@Pincode,
@Mobile,
@key
)
DECLARE @NewID DECIMAL
SELECT @NewID = SCOPE_IDENTITY()
DECLARE @new_image NVARCHAR(250)
SET @Return_Value = @@ERROR
IF @Return_Value <> 0
BEGIN
ROLLBACK TRAN
RETURN @Return_Value
END
ELSE
SET @Return_Value = @@ERROR
IF @Return_Value <> 0
BEGIN
ROLLBACK TRAN
RETURN @Return_Value
END
ELSE
BEGIN
COMMIT TRAN
RETURN @Return_Value
END
END

Answers (5)