SQL Server Insert rows by XML
Should be carefull when defining the source
With - Exact names of xml inputs
INSERT INTO @TblEmpSalaries
SELECT emp_no,currency,
Encryptbypassphrase(@EncrpKey,CONVERT(VARCHAR(20), base)),
Encryptbypassphrase(@EncrpKey, CONVERT(VARCHAR(20), current_ctc)),
country,onsiteoffshore
FROM OPENXML(@EmpSalariesHandler, '/dsUpdatedSalDtls/dtUpdatedSalDtls', 2)
WITH (Emp_No INT, Currency VARCHAR(50), Base FLOAT, Current_CTC FLOAT, Country VARCHAR(150),
OnsiteOffshore VARCHAR(50))
Comments