我執行下面的存儲過程,但它顯示錯誤。該錯誤是 '附近有語法錯誤。'即錯誤顯示‘xmlFields.Country’ 也請看看這個存儲過程,並幫助我的感謝,提前錯誤來執行存儲過程使用在sql服務器中打開xml
create procedure sp_SuUpdateSUADUsersStatus
(
@FinalEMPCode nvarchar(50),
@xmlFields NTEXT
)
AS
DECLARE @CityIDReturn INT
SET NOCOUNT ON
BEGIN
DECLARE @hdoc INT
EXEC sp_xml_preparedocument @hdoc OUTPUT, @xmlFields
BEGIN
EXEC @CityIDReturn=sp_SuSaveADUsersLocation @Country=xmlFields.Country,
xmlFields.State,xmlFields.City
FROM OPENXML(@hDoc, 'EmpCode/User', 2) WITH
(Country nvarchar(500),State nvarchar(500),City nvarchar(500))
as xmlFields
where xmlFields.Country <>'' and xmlFields.State <>'' and xmlFields.City
<>'')
END
EXEC sp_xml_removedocument @hdoc
End