Tuesday, September 7, 2010

Bulk insertion in sql server 2005?

DECLARE @DocHandle INT
EXEC SP_XML_PREPAREDOCUMENT @DocHandle OUTPUT, @vXMLPayDues
INSERT INTO tbl_4_LLPymnt(lk_tbl_5_LLs_ID, lk_tbl_3_Lctn_ID,
Month,
MM, YYYY,
D_Dt, Pymt_Typ_Ctgry, D_Amt,Current_Status)
SELECT @iLLsID,@v_LocID,
dbo.UDF_GetMonthNameFromDate(DATE),
Month(DATE),Year(DATE),
DATE,24,DUE,1
FROM OPENXML (@DocHandle,'/NewDataSet/Table', 2) WITH
(ID INT,DATE DATETIME,DUE MONEY)
EXEC SP_XML_REMOVEDOCUMENT @DocHandle

No comments:

Post a Comment