Hi,<div><br></div><div>I think the OGR MSSQL Spatial driver would be a better choice than OGR ODBC to connect to MS SQL Server 2008. You may however specify the driver in the connection string explicitly. The default is driver={SQL Server} which may not be sufficient in non Windows environments. You may probably use:</div>
<div><br></div><div>"MSSQL:driver=FreeTDS;..."</div><div><br></div><div>You may also require to use the latest SVN (trunk or branch-1-8) in order to get it working.</div><div><br></div><div>Best regards,</div><div>
<br></div><div>Tamas</div><div><br></div><div><br><br><div class="gmail_quote">2011/12/13 <span dir="ltr"><<a href="mailto:scott159@free.fr">scott159@free.fr</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
I install and configure FreeTDS and unixodbc to connect to SQL Server 2008. Everything is ok when I request database with tsql. But when I launch "ogrinfo ODBC:user/pwd@DSN", I have this error message :<br>
[unixodbc] [driver manager] data source name not found and no default driver specified<br>
What's the solution, environment variable ... ?<br>
<br>
Thanks<br>
<br>
<br>
----- Mail Original -----<br>
De: "Eduardo Kanegae" <<a href="mailto:eduardo.kanegae@gmail.com">eduardo.kanegae@gmail.com</a>><br>
À: "MapServer Users" <<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a>><br>
Envoyé: Samedi 26 Novembre 2011 15h49:27 GMT +01:00 Amsterdam / Berlin / Berne / Rome / Stockholm / Vienne<br>
Objet: Re: [mapserver-users] - SQL Server 2008<br>
<br>
The mapfile won't change so much. Basically your layer will have layer<br>
name, type, connection type and then in connection param something<br>
like<br>
<br>
"MSSQL:dsn=MY_DSN;server=(local);database=DBNAME_HERE;tables=myscheme.mytable;uid=USER_HERE;pwd=PWD_HERE"<br>
mytable<br>
<br>
Check OGR docs for more info <a href="http://www.gdal.org/ogr/drv_mssqlspatial.html" target="_blank">http://www.gdal.org/ogr/drv_mssqlspatial.html</a><br>
<br>
You might need freetds + unixodbc too<br>
<br>
<a href="http://www.sommarskog.se/mssqlperl/unix.html" target="_blank">http://www.sommarskog.se/mssqlperl/unix.html</a><br>
<a href="http://comments.gmane.org/gmane.comp.db.tds.freetds/13292" target="_blank">http://comments.gmane.org/gmane.comp.db.tds.freetds/13292</a><br>
<br>
In advance I can tell what I got: I gave up using default<br>
geometry/spatial types/functions from SQL 2008 - to slow, no official<br>
docs is available.<br>
<br>
To speed it up, I installed MsSqlSpatial lib (originally developed for<br>
SQL 2005 but also works for 2008) on SQL 2008 database + ODBC OGR<br>
driver on MapServer. And then spatial SQL speed gone 10-15 times over<br>
standard ms sql 2008 types<br>
<br>
<br>
<br>
Eduardo Patto Kanegae<br>
<a href="http://www.webmapit.com" target="_blank">http://www.webmapit.com</a> | @webmapit<br>
<br>
<br>
2011/11/26 <<a href="mailto:scott159@free.fr">scott159@free.fr</a>><br>
><br>
> Ok but I try to use it on Linux. Do you have some examples of mapfile to specify a sql 2008 connection ?<br>
><br>
> ----- Mail Original -----<br>
> De: "Eduardo Kanegae" <<a href="mailto:eduardo.kanegae@gmail.com">eduardo.kanegae@gmail.com</a>><br>
> À: "MapServer Users" <<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a>><br>
> Envoyé: Samedi 26 Novembre 2011 00h00:11 GMT +01:00 Amsterdam / Berlin / Berne / Rome / Stockholm / Vienne<br>
> Objet: Re: [mapserver-users] - SQL Server 2008<br>
><br>
> I'm sure about 2008 but 2000/2005 you can connect using FreeTDS client<br>
> libs - and probably an ODBC connection.<br>
><br>
> I also plan to publish more experiments using 2008/2005<br>
> <a href="http://blog.webmapit.com/2011/11/ms-sql-2008-spatial-experiments.html" target="_blank">http://blog.webmapit.com/2011/11/ms-sql-2008-spatial-experiments.html</a><br>
><br>
> regards<br>
><br>
> Eduardo Patto Kanegae<br>
> <a href="http://www.webmapit.com" target="_blank">http://www.webmapit.com</a> | @webmapit<br>
><br>
><br>
> 2011/11/25 <<a href="mailto:scott159@free.fr">scott159@free.fr</a>><br>
> ><br>
> > Hi,<br>
> ><br>
> > I would like to create a mapfile with SQL Server 2008 connection but i don't know how to configure it. With Windows, the driver is mssql2008.dll but my server run on Linux. How to do it ?<br>
> > When MapServer is running with fcgid mode, what's the best configuration ? Is it possible to have some examples of fcgid.conf ?<br>
> ><br>
> > Thanks<br>
> > _______________________________________________<br>
> > mapserver-users mailing list<br>
> > <a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
> > <a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
> _______________________________________________<br>
> mapserver-users mailing list<br>
> <a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
> <a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
_______________________________________________<br>
mapserver-users mailing list<br>
<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
_______________________________________________<br>
mapserver-users mailing list<br>
<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
</blockquote></div><br></div>