Quantcast
Viewing latest article 31
Browse Latest Browse All 119

re: SSIS: Custom Logging Using Event Handlers

Subah,

"I was looking at the double apostrophes option, however that was not of much help since I am unable to manipulate the text coming out of the description. "

Not sure I understand. You're inserting this into some sort of error log table right? So you are trying to dynamically build a string like this:

INSERT LogTable (ErrorMessage) VALUES ('<your_error_message>')

right?

So your expression would look like this:

"INSERT LogTable (ErrorMessage) VALUES ('+ REPLACE(@[System::ErrorDescription], "'", "") + "')"

================================================

"your suggestion is to build the ErrorDescription instead of using the system variable, correct?"

No, the Execute SQL Task allows you to use placeholders for parameters like so:

INSERT LogTable (ErrorMessage) VALUES ( ? )

and then you would assign @[System::ErrorDescription] to the question mark placeholder. That's sandard fucntionality in Execute SQL Task.

-Jamie


Viewing latest article 31
Browse Latest Browse All 119

Trending Articles