XML : SQL Server Stored Procedure XML can't get node right

I have this query here:

  SELECT [Job_No] as '@Key',  (  )  FOR XML PATH('Job_No'), ROOT('Root')    

and it returns like so:

  <Root>    <Job_No Key="ORC0023">    </Job_No>  </Root>    

How do I get it like so:

  <Root>        <Key>ORC0023</Key>      </Root>    

No comments:

Post a Comment