我正在通过 XML 文件更新表,但是当我执行 sql 代码时,它会抛出此错误:-
这是我的代码
IF(@PreppedUpdateModelXml is NULL OR @PreppedUpdateModelXml.exist('*') = 0)
BEGIN
--Create an internal representation of the XML document.
EXEC sp_xml_preparedocument @PID OUTPUT,@PreppedUpdateModelXml
UPDATE EquipmentModel
SET [Category] = em.[Category]
SELECT * FROM OPENXML (@PID, '/Root/NewDataSet',2)
WITH ([Category] VARCHAR(50), [ModelID] INT) AS em
WHERE EquipmentModel.ModelID = em.ModelID
END