[Qgis-developer] No geometry for sql server
Christophe B
ampouillle at gmail.com
Tue Apr 12 06:40:47 EDT 2011
Hello,
We have encountered a problem on version 1.7 of QGIS can support the
connection to SQL Server 2008.
When it connects to the base layer does not contain any vector object and
the attribute table contains the correct columns and many rows, but they all
contain "ERROR" ...
One of you has it managed to run this connection?
Thank you!
Christophe Baume
Code :
the sql table is defined as :
CREATE TABLE [dbo].[T_CommuneGeographie](
[COMGEO_Id] [uniqueidentifier] ROWGUIDCOL NOT NULL,
[COMGEO_Commune_COM_Id] [uniqueidentifier] NOT NULL,
[COMGEO_Geographie] [geography] NOT NULL,
[COMGEO_DateDebut] [date] NULL,
[COMGEO_DateFin] [date] NULL,
CONSTRAINT [PK_T_CommuneGeographie] PRIMARY KEY CLUSTERED
(
[COMGEO_Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF
, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
the lines entered into the python console:
conn_string =
"MSSQL:server=.\SQLExpress;database=ObservatoireCommerce;trusted_connection=yes;tables=dbo.T_CommuneGeographie(COMGEO_Geographie)"
qgis.utils.iface.addVectorLayer(conn_string,'test','ogr')
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-developer/attachments/20110412/646f1ab0/attachment.html
More information about the Qgis-developer
mailing list