我想问一下使用OpenXML解析XML时如何在SQL Server中抛出错误。这是微软的一个例子:
Insert Into Employee
SELECT EmployeeId, FirstName, LastName
FROM OPENXML (@hdoc, '/NewDataSet/Employee',1)
WITH (EmployeeId Integer, FirstName varchar(100), LastName varchar(100)) XMLEmployee
Where XMLEmployee.EmployeeId Not IN (Select EmployeeID from Employee)
如果根节点存在但其中没有 Employee 怎么办?
谢谢