title: SQL Server : Spatial query
body: <p>Consider we have some areas and multiple points are stored in two tables in SQL Server :</p>
  
  <pre><code>CREATE TABLE [dbo].[Areas](
      [Id] [int] NOT NULL,
          [Location] [geometry] NOT NULL)
  
  
          CREATE TABLE [dbo].[Points](
      [Id] [int] NOT NULL,
          [Location] [geometry] NOT NULL)
  </code></pre>
  
  <p>I know the function STIntersects uses to check if a polygon contains a point or not .<br>
  Is there any way to find points in areas for each area using single query ? <br>
  I don't know how to find points in areas because there are multiple areas . should I use cursor or for iteration ? If yes how ? </p>