[Qgis-user] Add mssql non-geometric tables

Peter Schürch p.schuerch at meierpartner.ch
Mon May 4 20:55:57 PDT 2015


Yes.

Regards
Peter Schürch
--
Meier und Partner AG
Freiestrasse 26<x-apple-data-detectors://1/0>
8570 Weinfelden<x-apple-data-detectors://1/0>
www.meierpartner.ch<http://www.meierpartner.ch/>
T +41 71 626 5115<tel:+41%2071%20626%205115>

Am 04.05.2015 um 07:33 schrieb "Nathan Woodrow" <madmanwoo at gmail.com<mailto:madmanwoo at gmail.com>>:

Hey Peter,

Do you have a primary key on the table, or a column that is a int which is unique?

Regards,
Nathan

On Mon, 4 May 2015 at 15:31 Peter Schürch <p.schuerch at meierpartner.ch<mailto:p.schuerch at meierpartner.ch>> wrote:
Hi James
Unfortunately the error message is a lot less specific as I thought... QGIS complains (in german, sorry) that the layer is invalid...


Layer ist ungültig: Der Layer dbname='geosfer' host=meiwes03 estimatedmetadata=true srid=0 table="dbo"."Borehole_Kind" sql= ist ungültig und kann der Karte nicht hinzugefügt werden

This brings me back to the original question: what makes a flat table valid for QGIS? Is there any meta information needed somewhere?
Hopefully you can make some sense of this.

Cheers, Peter

Von: James Wood [mailto:jwood911 at gmail.com<mailto:jwood911 at gmail.com>]
Gesendet: Samstag, 2. Mai 2015 16:22
An: Peter Schürch
Betreff: Re: [Qgis-user] Add mssql non-geometric tables

Hey Peter,
Yes, the problem is a little clearer now, thanks. When adding what we refer to here as a "flat table" (i.e., no geometry), it always just adds as a table object, so I've never seen that error before. The exact error message would be helpful. Also, what version of SQL Server are you running?

James
Sent from my iPhone

On May 2, 2015, at 04:01, Peter Schürch <p.schuerch at meierpartner.ch<mailto:p.schuerch at meierpartner.ch>> wrote:
Hi James
Thanks for getting back to me.
I'using Wien too.
The database connection is established. I can add existing geometry layers from the DB to the qgis project. I can also add new layers to the DB (e.g. A shape). So no fundamental problem with the DB.

My problem is the following.
I have defined a table in the DB without geometries, just numeric data. I can see it in the qgis browser but when i try to add it to my project i get an error saying that it is missing a crs. So i guess there is some meta info missing somewhere, but i wonder where and whether it has something to do with the metadata table 'geometry_colums' required for spatial layers. I need to look up the exact error message when I'm back in the office.

Hope this is a little clearer now :-)
Regards.
Peter
--
Meier und Partner AG
Freiestrasse 26
8570 Weinfelden
www.meierpartner.ch<http://www.meierpartner.ch>
T +41 71 626 5115

Am 01.05.2015 um 02:34 schrieb "James Wood" <jwood911 at gmail.com<mailto:jwood911 at gmail.com>>:
Hey Peter. Did you get a response to your question? I may not be understanding exactly what you are trying to do, but if you go ahead and add your MSSQL instance and connect to the database, you will be presented with both spatial and non -spatial tables that you can add into the map.

So, (not to patronize), if you go to Layer > Add Layer > Add MSSQL Spatial Layer, that will present a dialog where you can choose your instance from the drop down or create a new connection. The list of all available table objects will appear once you hit connect. I'm using 2.8 Wien.

HTH and I haven't missed your question entirely.

James
Sent from my iPhone

On Apr 30, 2015, at 13:55, Peter Schürch <p.schuerch at meierpartner.ch<mailto:p.schuerch at meierpartner.ch>> wrote:
Hi
Does anybody know how to add a non-geometric table from an mssql database to a qgis project?
Do I need to add it in the table "geometry_columns"? If yes what would be the appropriate attribute values there?
Thanks
Peter Schürch
--
Meier und Partner AG
Freiestrasse 26
8570 Weinfelden
www.meierpartner.ch<http://www.meierpartner.ch>
T +41 71 626 5115
_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org<mailto:Qgis-user at lists.osgeo.org>
http://lists.osgeo.org/mailman/listinfo/qgis-user
_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org<mailto:Qgis-user at lists.osgeo.org>
http://lists.osgeo.org/mailman/listinfo/qgis-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20150505/a2a43f42/attachment.html>


More information about the Qgis-user mailing list