Hi all,
how can i validate xml node using xmlnamespace in storedprocedre
i have tried it
but its saying that ,
Incorrect syntax near the keyword 'IF'.
My code is :
ALTER PROCEDURE mch
@xmldoc XML
AS
BEGIN
;WITH XMLNAMESPACES('http://MCH.com/IF002/SD/MCGG/MCH' as ns0)
IF(SELECT @xmldoc.exist('//ns0:Brand_In/MC/MC1') AS BrandData)=0 BEGIN RAISERROR('MC1 not available in document',16,1); RETURN ; END
END