Skip to main content
Question

Column's default values when inserting row in SQL Server

  • September 7, 2015
  • 2 replies
  • 72 views

Hi people, me again,

 

 

Why FME's SQL Server Non-Spatial Writer does't see column's default contraints? My table has column that is neither unique nor primary nor nillable, but has default constraint. In my workflow I'm not specifying any value (in some cases) to that columns, because I intend to use that default value. Thing is that FME doesn't write any row to that table because of missing value.

What is going on?

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

takashi
Celebrity
  • September 8, 2015
Hi,

 

 

Try setting NO to the "Bulk Insert" parameter of the writer. It could work to write the default values as expected, although I don't know the exact reason...

 

 

Takashi

david_r
Celebrity
  • September 8, 2015
Hi

 

 

If your attributes have empty values (empty strings, not NULL) when the feature hits the writer, SQL Server won't apply the default values since you (FME) specified a value (empty string). You could use a NullAttributeMapper to map empty strings to proper NULL values to fix this.

 

 

David