Hi,
Do you want to do something like this?
Query:
INSERT INTO [dbo].[Test_Reports]
([ByteArray],
[ColumnTest],
[ColumnTest2])
SELECT x.Test_Reports.value('(ByteArray)[1]', 'int'),
x.Test_Reports.value('(ColumnTest)[1]', 'varchar(50)'),
x.Test_Reports.value('(ColumnTest2)[1]', 'varchar(50)')
FROM @XMLDoc.nodes('/NewDataSet/Test_Reports') AS x(Test_Reports)
WHERE NOT EXISTS (SELECT 1
FROM [dbo].[Test_Reports]
WHERE ( [ByteArray] = x.Test_Reports.value('(ByteArray)[1]', 'int') )
AND ( [ColumnTest] = x.Test_Reports.value('(ColumnTest)[1]', 'varchar(50)') )
AND ( [ColumnTest2] = x.Test_Reports.value('(ColumnTest2)[1]', 'varchar(50)') ));