Scenario
I have a stored procedure written in T-Sql that I use to insert data into a table as XML. Since the data gets updated regularly, I want the rows to be updated if they already exist (Aside from when the application is first run, they will always exist).
Question
Below is the code of my Insert Sproc, however I cannot seem to workout the Update side of the stored procedure & would appreciate some help.
CODE
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER PROCEDURE [dbo].[INS_Curve]
(
@Curve varchar(MAX)
)
AS
DECLARE @handle int
exec sp_xml_preparedocument @handle OUTPUT, @Curve
INSERT INTO CurveDB..tblCurve(LoadID,BusinessDate, Factor)
SELECT LoadID,BusinessDate, Factor
FROM OPENXML(@handle, 'NewDataSet/Table1',2)
WITH(
LoadID int,
BusinessDate DateTime,
Factor float
)
exec sp_xml_removedocument @handle