The tMSSqlOutput component in Talend Open Studio for Data Integration v5 will create tables if the "Create table" or similar action is used. Build up the target schema using the Edit schema dialog, adding a column for the auto increment identity.
Basic Tab Configuration of tMSSqlOutput |
Schema with an Identity Column |
You'll also need to make sure that the transformation does not attempt to write to the auto increment column since the value will be provided with the database. Even if you don't explicitly map a value to the auto increment column, Talend will attempt to insert a null into the column which will result in an error.
Don't Write to the Identity
This protection is given using the Field options on the Advanced tab.
Set Insert / Update Behavior for nonResRealPropertyId |
For more flexibility, you might consider working with the Additional columns. See the following blog post for an example using this technique.
Controlling the DDL Behind Talend Open Studio's tMySqlOutput
Thank you for this, I have been pulling my hair out over creating an identity field in Talend for hours now.
ReplyDeleteThanks for your help, I have the same problem than anonymous, good job!!
ReplyDeletehow to get Return codes using database driven (table) with tdie or twarn components
ReplyDelete