Just to clarify up-front: I\'m talking about unioning geometry, not the SQL keyword UNION
.
I\'m trying to move some spatial data from Postgres with Post
Your best option is to create a CLR function to support the aggregate. There are a couple of existing solutions:
The way I ended up doing this is with variables:
DECLARE @Shape GEOMETRY
SET @Shape = GEOMETRY::STGeomFromText('GEOMETRYCOLLECTION EMPTY', @MySrid)
SELECT @Shape = @Shape.STUnion(Shape)
FROM MyShapeTable
It's not as nice, but it works.
Is the UnionAggregate function SQL2012 only?
SELECT geography::UnionAggregate( geometry ) FROM some_table
Hmm guess so. http://technet.microsoft.com/en-us/library/ff929095.aspx