ssis expression in execute sql task

  • Hi All

    I am writing an expression in execute sql task in SSIS to log errors. The expression is:

    "insert into errorlog values ("+(DT_WSTR, 20)@[System::ErrorCode]+", "+@[System::ErrorDescription]+")"

    Its not working. Can anybody help me to correct it.

    Thanks

  • You're missing single quotes, assuming you're trying to insert to MSSQL.

    "insert into errorlog values ('"+(DT_WSTR, 20)@[System::ErrorCode]+"', '"+@[System::ErrorDescription]+"')"

    Out of interest, why not just use the log providers built into SSIS? There is a provider that will log to SQL just like you're trying to do.

    Steve.

  • Hi

    Thanks for the reply.

    I am not data into oracle. Will the expression that you suggested will work there too.

    Thanks

  • I have made a typing mistake in the last post. Ignore it please.

    Actually i am loading the data into oracle and as far i know ssis does not have the in built functionality to log data into oracle database.

    Will the expression suggested by you will work in oracle too. i want to log error code and error description in oracle

    database when ever a package fails. i am doing this in event handler.

    Please advice.

    Thanks

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply