re : Validating Duplicate Record of SQL Database before Inserting & Updating
Hi,
Thanks for your support and happy to go through it. Well i have got one store procedure for insert which works fine. If i want to add a validation in my insert stored procedure then how will i.
This my Stored Procedure:
/*
Name: usp_InsertContactTitleSetup
Description: Insert the Record to dbo.hrContactTitlesSetup table
Author: Tashi
Modification: Insert
Description Date Changed By
Created Procedure 25/02/2011 Tashi
*/
CREATE PROCEDURE [dbo].[usp_InsertContactTitlesSetup]
(
@CtsTitleID CHAR(4),
@CtsTitle VARCHAR(10),
@IsDefault BIT,
@SetDate DATETIME,
@UserName VARCHAR(20),
@CMD_Flag CHAR(1)
)
WITH ENCRYPTION
AS
INSERT INTO [dbo].[hrContactTitlesSetup] VALUES
(
@CtsTitleID,
@CtsTitle,
@IsDefault,
@SetDate,
@UserName
)
INSERT INTO [dbo].[hrContactTitlesSetup_Audit] VALUES
(
@CtsTitleID,
@CtsTitle,
@CMD_Flag,
@IsDefault,
@SetDate,
@UserName
)
where the validation line will go, can you please help me.
Tashee