Question

Column's default values when inserting row in SQL Server

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


2 replies

Userlevel 2
Badge +17
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
Userlevel 4
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

Reply