While testing features of QGIS I tried to query each table using right click and query but I can't query sql server 2008 database :

An error occured when executing the query.
The data provider said:
[microsoft][odbc sql server driver][sql server] invalid object name 'table_test'
qodbc3:unable to execute statement

but it works fine with postgis.

Also, is there any why to join table and do the query?

enter image description here

  • the error hints that there is no table named SITES_2G , so wrong database or wrong schema would be my best guess or odbc driver is case sensitive (that depends how driver escapes table names – simplexio Apr 3 '14 at 6:33

you need to define ODBC connection from Admintools -> "Data sources" use name as provider/DNS , then tell QGIS to use it. Also dont enable "only look in the geometry_columns table"


I think you need to have a geometry_columns table in the database in order to connect. Nathan has some more details on this post

  • I have already connected to database but it's problem while I query the database – kinkajou Sep 7 '12 at 11:05

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.