Skip to main content
Question

Column's default values when inserting row in SQL Server

  • September 7, 2015
  • 2 replies
  • 59 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?

takashi
Supporter
  • 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
Evangelist
  • 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

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings