SELECT
(SELECT v_value as "@value", columnname as "@columnname",
updatedby as "@updatedby", emailid as "@emailid",
updatedon as "@updatedon"
from nodetable, Progresss PGA, mastertable
where columnname ='SSNNO'
and PGA.ProjId=9
AND OBSID IN (SELECT NodeId FROM projecttable
WHERE ParentId=mastertable.roles AND Title='some value')
AND UserId=1
AND mastertable.FileID=nodetable.fileid
AND mastertable.FileID=821
ORDER BY updatedon desc FOR XML PATH('Forms'), TYPE)
FOR XML PATH('Form'), TYPE
This is my query for getting the XML.. Don’t worry its works fine..
But my problem if the condition fails I want to print the one more tag that it always tells what happened in the query..
Like for this query if all the conditions succeed I’ll get complete XML..
Else I’ll get
<Form />
But I want to print result like in failure case..
<Form SUCCESS="0"/>
As one statement