In QGIS (2.8) I am trying to add non-geometric data / flat data that originates in a MS SQL database. This flat data later should be joined with other layers etc.

Connecting to the specific database = working Listing the table that I would like to open up in QGIS = working

When adding the selected 'flat' table I get the following error message:

dbname='data' host=server\sql2008 table="dbo"."TABLE" sql= is an invalid layer - not loaded

Is there a "trick" or a set of conditions that the table needs to meet before it can be added into QGIS as "flat" data?


It apears QGIS is looking for atleast one integer value in the data. The solution consists of creating a view based on the original table including an extra col:


This view can than be added in QGIS using the method described earlier.

It might be interesting to know how one could tell QGIS that this data is containing X/Y coordinates for later use.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.