[postgis-users] OT: Export/copy postgres geometry to sql server with bcp

Richard Greenwood richard.greenwood at gmail.com
Thu Jun 30 16:29:28 PDT 2011


I'd suggest that you try ogr2ogr.

Rich

On Tue, Jun 28, 2011 at 6:48 AM, Charles Galpin <cgalpin at lhsw.com> wrote:
> Sorry for the somewhat off topic question, but I figured someone here has probably dealt with this.  I am using postgis and am very happy with it, but for various reasons I need to export some of our data to sql server periodically and want to automate it, preferably to fit into our existing framework which uses bcp to import from flat files.  However looking at the binary output of a straight "copy" to CSV the binary formats do not look the same. Is there any way to export to a format that bcp can understand?
>
> I can export the wkt, strip quotes, import into a temp table and then use an insert select to fill the destination table converting the wkt back to a geometry but this is less than ideal.
>
> tia,
> charles
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>



-- 
Richard Greenwood
richard.greenwood at gmail.com
www.greenwoodmap.com



More information about the postgis-users mailing list