<p>I have some shapefile (demographic/heat map data in the USA, such as crime in New York) data imported into a sql server 2008 database, field data type: <em>Geography</em>.</p>

<p>How can i get this data, from a <em>select</em> query, in a format which i can then display on google maps or microsoft virtual earth?</p>

<p>thanks!</p>

<p>Edit 1: So far, the best solution has been to use a (free) 3rd Party dll (<a href="http://www.codeplex.com/SharpMap" rel="nofollow noreferrer">SharpMap</a>). I'm hoping someone might suggest some sql tricks in sql2008 to return it in a compatible format ...</p>

The easiest way to do this is to select to XML and then transform the data into GeoRSS or KML.  Virtual Earth and Google Maps both have support for KML so that would probably be the easiest way to do it.
There are considerations though.  If you have many many vertices in your data you probably want to implement some sort of AJAX method to retrieve only the data in the map view.  You can generalize data in SQL 2008 to make a fewer amount of vertices depending on your zoom level.  If you are zoomed out to a country level you don't need nearly as much detail as zoomed into a town.
MapDotNet
has a lot of features for getting your data in a Virtual Earth map more easily.  It is relatively easy to perfrom a select query and display the data as you desire.  I'm sure there are other similar products for Google maps but I haven't personally used them.  It has support for polygons as well as heat maps and gives you a lot more functionality than just using Virtual Earth.  Virtual Earth is powerful but there are a lot of GIS tools someone from a mapping background would expect that you have to program in yoursef.