title: Divide the coordinates into X and Y coordinates from a table having geometry data in SQL Server 2012
body: <p>I have a table with a column <code>Shape</code> of <code>geometry</code> datatype. </p>
  
  <p>This is the data in <code>Shape</code> :</p>
  
  <pre><code>POLYGON ((565542.98375 2127263.4997410, 565538.48450 2127261.3187302, 565541.96658 2127254.1162, 565546.465835 2127256.297297, 565542.9837 2127263.49974102))
  POLYGON ((565547.281621307 2127097.9410014, 565549.457915 2127093.43948425, 565553.577449391 2127084.9189882, 565568.882475 2127092.31709055, 565562.586805441 2127105.3404182, 565547.2816807 2127097.94105044))
  </code></pre>
  
  <p>and so on....</p>
  
  <p>I need output as </p>
  
  <pre><code>ID | X               | Y 
  ---+-----------------+-----------------
  1  | 565542.98375    | 2127263.4997410
  1  | 565538.48450    | 2127261.3187302 
  1  | 565541.96658    | 2127254.1162 
  1  | 565546.465835   | 2127256.297297 
  1  | 565542.9837     | 2127263.49974102 
  2  | 565547.281627   | 2127097.9410014 
  2  | 565549.457915   | 2127093.43948425 
  2  | 565553.5774391  | 2127084.9189882
  </code></pre>
  
  <p>and so on in table format</p>