Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to use SSIS to transfer point data from a Geography column in SQL Server 2008 R2 to a geometry column in a Greenplum (Postgres 8.2.15) database with PostGIS. I know there's a way to do the conversion outside of SSIS because I did it once a while back, unfortunately I don't remember what I did.

share|improve this question
I think I'm on the right track. I can use a query for the input that converts to POINT text using geometry::STGeomFromWKB(myPointColumn.STAsBinary(), myPointColumn.STSrid).STAsText(). Then I won't need a data transformation at all. – influent Nov 9 '12 at 21:01
up vote 1 down vote accepted

I figured it out. I used a query for the SQL Server source that converts to POINT text using:

geometry::STGeomFromWKB(myPointColumn.STAsBinary(), myPointColumn.STSrid).STAsText()

That was all it took. Now whether the point will be represented in PostGIS the way I intend it to I can't say at this point, but I'm hoping so.

share|improve this answer

You could use ogr2ogr.
I'm not certain if you can do a direct import, but at the very least you can export to a SHP file, and then import the SHP file to PostGIS with shp2pgsql. It ships with PostGIS. b

share|improve this answer
Could you add a bit of explanation about how an SHP is imported to PostGIS? – dezso Nov 10 '12 at 9:36
Use the shp2pgsql tool. It ships with PostGIS. – Steve Horn Nov 11 '12 at 2:22

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.