The below code is only pulling the outcome_id value, but is pulling
back null for the other fields in the xml string, any ideas on what is
going on?
-- Prepare xml data to be transfered into an xml table in sql server
DECLARE @xmlTable varchar(8000)
DECLARE @DocHandle int
select @xmlTable = '<DATA><xmlRow outcome_id="35"
dt_outcome="12/1/2004" patient_regimen_id="21" regimen_id="2"
record_type="existing" /></DATA>'
EXEC sp_xml_preparedocument @DocHandle OUTPUT, @xmlTable
SELECT xmlTables.*
FROM OPENXML (@DocHandle, '/DATA/xmlRow') WITH
(outcome_id int '@outcome_id',
patient varchar '@chvOutcomeDte') AS xmlTables
-- Close the xml table
EXEC sp_xml_removedocument @DocHandle
I did have this working in another stored procedure, but this one does
not seem to want to work. I really need some help on this, thanks.