error come to execute the stored procedure using with open xml in sql server
- by Muthumari
Hi,
 i execute the below stored procedure.but it shows the error. The error is
 'Incorrect syntax near '.'.i.e error shows in 'xmlFields.Country'
 please look this stored procedure also and help me thanks, in advance
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