I'm having an issue with viewing data in QGIS 2 based on a spatial query in SQL Server 2008 R2.
The data appears to load, polygons appear and I can add thematic shading based on data.
However when I view the attribute table for the layer in QGIS, it seems like the same value is being replicated over and over again.
If I add labels, only one label appears despite there being multiple features with different attributes in the original SQL Spatial query.
When I export the layer to a shapefile and open it in QGIS, all the data appears correctly and labelling works without any problem.
Why is the layer imported from SQL Server behaving so strangely?