title: SQL Server 2008 Spatial: find a point in polygon
body: <p>I am using SQL Server 2008 spatial data types. I have a table with all States (as polygons) as  data type GEOMETRY. Now I want to check if a point's coordinates (latitudes, longitudes) as data type GEOGRAPHY, is inside that State or not.</p>
  
  <p>I could not find any example using the new spatial data types. Currently, I have a workaround which was implemented many years ago, but it has some drawbacks.</p>
  
  <p>I've both SQL Server 2008 and 2012. If the new version has some enhancements, I can start working in it too.</p>
  
  <p>Thanks.</p>
  
  <p>UPDATE 1:</p>
  
  <p>I am adding a code sample for a bit more clarity.</p>
  
  <pre><code>declare @s geometry  --GeomCol is of this type too.
  declare @z geography --GeogCol is of this type too.
  
  select @s = GeomCol
  from AllStates
  where STATE_ABBR = 'NY'
  
  select @z = GeogCol
  from AllZipCodes
  where ZipCode = 10101
  </code></pre>