Scribe Workbench: Conversion failed when converting date and/or time from character string.

Problem:

During an insert step in Scribe Workbench, I wanted to populate a CreatedDateTime field with the current time. This field is a datetime2 in the SQL server. So I put in NOW( ) like this:

image

But, instead of capturing a timestamp and putting it in, I got the following error in the execution log:

image

Solution:

Change NOW( ) to the following: TEXT( NOW( ), “MM-dd-YYYY hh:mm:ss”)

Like this:

image

This will take the value captured from the NOW( ) as a string and convert it into type datetime2. No more errors! 🙂

Filed under: ETL

No comment yet, add your voice below!


Add a Comment

Your email address will not be published. Required fields are marked *

Comment *
Name *
Email *
Website

This site uses Akismet to reduce spam. Learn how your comment data is processed.