Hola estoy tratando de ejecutar esto en sql server 2014 y cuando ejecuto me genera el siguiente error:
Msg 6602, Level 16, State 2, Procedure sp_xml_preparedocument, Line 1 [Batch Start Line 0] The error description is 'A semi colon character was expected.'.
Se que es por el caracter & que esta dentro de la etiqueta ACTIVITYTYPENAME contiene el caracter &, cuando se lo quito se ejecuta perfecto.
DECLARE @@hDoc int
EXEC sp_xml_preparedocument @@hDoc OUTPUT,
'<ROOT>
<mdscheduler REASON="Client Not Home" ACTIVITY="" ACTIVITYTYPENAME="sdf &bsf sf" ACTIVITYTYPECODE="SD1233" ALLDAY="F" BACKCOLOR="0" CONTACT="Anthony Adams" DONE="F" FONTCOLOR="-16777208" FONTSIZE="8" ICONINDEX="-1" NOTES="DAY PHONE :
NIGHT PHONE :
CELL PHONE :
CO-PAY : $ 0.00
ALERT :
Facility : WAIV
" ACTIVITYID="419275610553243" DUEDATE="" FACILITYCODE="WAIV" REMINDER="F" REMINDERTIME= "" SUBJECT="Anthony Adams - CANCELLED" THERAPISTCODE = "AMBHUN" PATIENTCODE="1800244" TIMEIN="8:15 AM" TIMEOUT="8:30 AM" GROUPCREATIONID="437275110343288" ENDDATE="09/19/2019" TRANSDATE="09/19/2019" STATUS="reoccurrence" />
</ROOT>'
INSERT MdScheduler
SELECT *
FROM OPENXML(@@hDoc, '/ROOT/mdscheduler')
WITH mdscheduler
EXEC sp_xml_removedocument @@hDoc