title: Query to identify gaps in time data
body: <p>I'm pretty new to database programming, and I'm in need some help writing what seems to be a complicated t-sql query.</p>
  
  <p>Our database stores time data along with various levels recorded at that time.  A typical measurement will last for weeks or months.  I need to write a query in SqlServer2005 to identify gaps in the time data to know when the instrument wasn't communicating.  Our sample interval can be either 1 sec or .5 sec, but it will always be the same in a given measurement (ie: all samples in a measurement will be either 1 or .5 samples/sec).</p>
  
  <p>Ideally I would like to get a list of 
  [block1-start block1-end]
  [block2-start block2-end]
  etc</p>
  
  <p>where each block is a unit of consecutive times within the overall measurement.</p>
  
  <p>Are there any commands in TSQL that would make this query easier?</p>