I have an ASP.NET page written in C#, which has an upload button to upload a XML file. I can choose the XML file and display in grid view, which is working fine, and whenever I upload a file which has been already uploaded, it rejects the xml file with duplicate records validation.
I created a stored procedure which inserts the XML data into a temp table and then checks in the main table if the same data already exsits in the main table, and if so, it will delete those bits of data.
I need a validation message showing the there are duplicate data. How do I do it?
This is my stored procedure:
CREATE PROCEDURE [dbo].[insertDetails]
CREATE TABLE #XMLConfig
ID int IDENTITY,
SET NOCOUNT ON;
INSERT INTO #XMLConfig
Configuration.value('(Group/text())','VARCHAR(max)') AS [group],
Configuration.value('(Key/text())','VARCHAR(max)') AS [key],
Configuration.value('(Label/text())','VARCHAR(max)') AS [label]
@xml.nodes('/MerchantCageSettings/Configuration') AS TEMPTABLE(Configuration)
FROM #XMLConfig xc
INNER JOIN xmlDataconfig gp ON xc.[group] = gp.[group]
AND xc.[key] = gp.[key]
AND xc.[label] = gp.[label]
INSERT INTO xmlDataconfig
In other stored procedures, I use
How do I add it or what condition should I use exactly?