Robert Sacoman
Robert Sacoman

Reputation: 27

How to load a timestamp variable from SQL Server in SSIS to pull from Teradata?

Running into an issue where I am getting this error in an SSIS package:

[ODBC Source [52]] Error: Open Database Connectivity (ODBC) error occurred. state: '22008'. Native Error Code: -6760. [Teradata][ODBC Teradata Driver][Teradata Database](-6760)Invalid timestamp.

What I am doing is passing a variable into a Teradata query that is pulled from SQL server. All housed within a sequence container.

select cast(dateadd(day,1, max(date))AS datetime) DateStart from [table]

the desired output should be:

2022-06-08 00:00:00.000

While this is the result I am passing to the variable, SSIS is kicking this back with the error above.

Pretty stuck here, would love some input from the community.

Upvotes: 0

Views: 266

Answers (1)

access_granted
access_granted

Reputation: 1927

You need this expression:

select Current_Timestamp(3);

Or if you want the day before, you would do this:

select to_char(Current_date()-1,'YYYY-MM-DD HH24:MI.SS.FF3');

Upvotes: 1

Related Questions