Good Day all
I have a Sp that is written like this
set ANSI_NULLS ON set QUOTED_IDENTIFIER ON go ALTER PROCEDURE [dbo].[Import_RegistrationsXM] @xml ntext AS set nocount on DECLARE @doc int EXEC sp_xml_preparedocument @doc OUTPUT, @xml TRUNCATE TABLE _RegistrationXM INSERT INTO _RegistrationXM SELECT * FROM OPENXML ( @doc , 'Import/Item' , 2) WITH ( Student varchar(32), SubjectCode varchar(32), Campus varchar(32), Repeat bit ) EXEC sp_xml_removedocument @doc truncate table _Duplicates exec( 'sp_RegistrationsXM_Populate' ) select 'XM Registrations successfully imported!' [Result]
i have an XML File that is 3.21mb, when i this Sp with the XML i get the Following Error
Exception caught in: ExecuteStoredProc: Cannot insert duplicate key row in object 'dbo._RegistrationXM' with unique index '_RegistrationXM_index'. The statement has been terminated. [/pre]
in the table
_RegistrationXM there are no Records and in the File there are no Duplicates too.
Edited by mike_2000_17: Fixed formatting