error come to execute the stored procedure using with open xml in sql server
Posted
by Muthumari
on Stack Overflow
See other posts from Stack Overflow
or by Muthumari
Published on 2010-06-09T10:41:32Z
Indexed on
2010/06/09
10:42 UTC
Read the original article
Hit count: 281
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
© Stack Overflow or respective owner