Take the 2-minute tour ×
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. It's 100% free, no registration required.

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
add comment

2 Answers 2

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
add comment

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. bostongis.com/pgsql2shp_shp2pgsql_quickguide_20.bqg –  Steve Horn Nov 11 '12 at 2:22
add comment

Your Answer

 
discard

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.