1

I would like to link a database with non-spatial data (it is just text and numbers) with a shapefile in QGIS. (Note: it is Microsoft SQL Server Management Studio) How do I do that?

If I am able to connect the database can I join both a specific table from SQL with the .shp file using a common ID?

5
  • Are you able to make a connection to your MSSQL database in QGIS? If so, loading the non-spatial table into QGIS will only work if the table has an OBJECTID or other unique Id column, and if the SHP and the MSSQL table have a shared column / key, you should have no problem. Commented Oct 10, 2017 at 15:32
  • I am trying to figure that out now. Apparently I can't seem to make a connection. Cant seem to get the correct Provider/DSN and Host from SSMS - do you know where/how I can get that info?
    – Bernie
    Commented Oct 10, 2017 at 16:20
  • Can you connect in SSMS? Its the same connection info - don't use Provider/DSN, instead use the HOST option, then with username/password added, click the 'list databases' button to the right to see if your connection works... Commented Oct 10, 2017 at 16:38
  • I have connected to the SSMS but i cant seem to load the layer - it keeps saying it 'is an invalid layer'. Does it matter if the Type states 'No Geometry'? There is a column that is the same which is in a text format but not in a OBJECTID format - does that matter?
    – Bernie
    Commented Oct 11, 2017 at 9:59
  • @Bernie- It matters if the type states 'No Geometry'. You will not be able to load it into QGIS.
    – VGu
    Commented Oct 16, 2017 at 5:52

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.