Skip to main content

I simply need to update a geometry column in a SQL Server table that is previously set to NULL. 

Could someone provide me with a simple example? 

I can't do it neither with a SQL Executor (previously using a GeometryExtractor to convert this geometry in Microsoft SQL Server Binary) nor with a featureWriter.

 

I found this conversation from a while back but it didn't help me: 

 

Thank you!

What do you mean you can’t do it with an SQLExecuter or FeatureWriter? as in you’ve tried and it doesn’t work, or there are other constraints you have?


Use a Microsoft SQL Spatial Writer:

  • For the Table Definition use Import from dataset, and select the table you want to update. 
  • Make sure Feature Operation is set to Update, and Table Handling to Use Existing.
  • ALso make sure that Update Spatial Column(s) is set to Yes.

For Match Columns, it would be preferable to select the Primary Key of the table, but at the very least it should be a column that uniquely identifies each row in the table.

Lastly: make sure every feature that you push into this writer has a matching value for the Match Column, and has a proper FME geometry. There’s no need to extract the geometry or convert it or anything, the Writer will take care of that as long as you’ve selected the Microsoft SQL Server Spatial format when adding your writer.

If you’re using a FeatureWriter it is much the same. There is no need to convert the geometry to Microsoft SQL Server Binary or anything, just leave it as regular FME geometry.


Reply