Dear All,
May i know how to a SQL script in stored procedure to check the duplicate data, if found duplicate data, then insert one record only.
thank you
Refer this example
http://www.aspforums.net/Threads/149003/How-to-avoid-duplicate-record-inserts-in-SQL-Server-using-C-and-ASPNet/
If you want to add another record with the same name if found duplicate then you need to check the condition like this
DECLARE @recordCount INT SET @recordCount =( SELECT count(*) FROM Branch Where BranchName = 'IT') IF @recordCount = 1 BEGIN --INSERT SOMETHING END ELSE BEGIN --INSERT SOMETHING ELSE END
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.