title: SQL Server Circle
body: <p>I'm trying to create a circle in a SQL Server based on a midpoint and a radius.    </p>
  
  <p>This seems to be close as a solution, but it creates an oval or an ellipse vs a circle. Is there another way to create a circle?</p>
  
  <pre><code>DECLARE @g geometry;
  SET @g = geometry::STGeomFromText('POINT(-88.0 44.5)', 4326);
  select @g.BufferWithTolerance(5, .01, 1)
  </code></pre>
  
  <p>I'm currently using SQL Server 2008.  </p>
  
  <p>This code also demonstrates the problem. The spatial results look like a circle, but when I draw the circle on google maps it is oval. Also, when I use <code>STContains</code> to see what points are in the circle, it is definitely following the oval outline.   </p>
  
  <pre><code>IF EXISTS (SELECT * FROM [tempdb].[sys].[objects] WHERE [name] = N'##circle')
      DROP TABLE ##circle;
  
  CREATE TABLE ##circle
  (
      [Polygon] [geometry] NOT NULL
  )
  
  DECLARE @g geometry;
  SET @g = geometry::STGeomFromText('POINT(-88.0 44.5)', 4326);
  
  insert into ##circle (Polygon) 
  values (@g.BufferWithTolerance(.5,.01,1))
  
  select Polygon from ##circle
  </code></pre>