Thursday, March 22, 2012

Converting @[System::StartTime] to String

I am trying to get the System::StartTime into a table, but I get this error in my expression builder saying "Cannot convert 'System.DateTime' to 'System.String'

I have tried (DT_TEXT, 1252) @.[System::StartTime] but I get the following

Attempted to read or write protected memory. This is often an indication that other memory is corrupt. (Microsoft.DataTransformationServices.Controls)

I also tried (DT_STR, 23, 1252) @.[System::StartTime] and I get the following error

The expression " (DT_STR, 23, 1252) @.[System::StartTime]" has a result type of "DT_STR", which cannot be converted to a supported type.

Any help?In which task are you trying to do this?
Because when I have this in my Execute SQL task:
"INSERT INTO temp (tempText) VALUES ('" + (DT_STR, 23, 1252) @.[System::StartTime] + "')"
As expression for sql statement it processes fine|||I am doing it is a Execute SQL task.

Can you tell me did you put the in the expression or is that directly in the SQL statement?|||

TheViewMaster wrote:

In which task are you trying to do this?
Because when I have this in my Execute SQL task:
"INSERT INTO temp (tempText) VALUES ('" + (DT_STR, 23, 1252) @.[System::StartTime] + "')"
As expression for sql statement it processes fine

Sorry I just saw this

"As expression for sql statement it processes fine"

No comments:

Post a Comment