Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have dates in the form of 07-28-2010 I am extracting from DWG filenames. I need to push these to a DateTime formatted table in non-spatial SQL Server 2008. SQL Server doesn't like them as strings coming in from the ETL apparently. How can I set the datatype in the ETL from string to datetime? Is this even what I need to do? I'm pretty sure this is my issue based on past experience with pushing dates to SQL Server and this error from FME:

MS SQL Server Writer: 1 attribute value(s) failed conversion, and were written as NULL values
share|improve this question
up vote 5 down vote accepted

From the FME Readers and Writers Manual:

When writing to the database, the writer expects the date attribute to be in the form YYYYMMDDHHMMSS.

You'll probably need to use the DateFormatter transformer to get this format. I would:

Use a StringReplacer to replace the - with / in the date attribute Use a DateFormatter set to %Y%m%d or %Y%m%d%H%M%S including time (be sure to get the case right) Write it to a datetime field in the SQL Server output

share|improve this answer
Thanks Mark. I ended up using a StringSearcher and a regex to get the date out of the filename, then in a StringConcatenator I rearranged the _matched_parts to YYYYMMDD. This then inserts into the datetime SQL Server field just fine. – Chad Cooper Nov 9 '10 at 19:48

Creator> TimeStamper> [^d-^b-^y] > SQLExecutor [DBMS settings] should work

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.