Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

[Execute SQL Task] Error Expand / Collapse
Author
Message
Posted Thursday, November 11, 2010 12:21 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Monday, June 23, 2014 5:28 AM
Points: 28, Visits: 174
Hi All

i have create an SSIS and add an onerror in the event handler i added Execute SQL Task which worked fine all this time now it stopped work i deleted it an add a new one but still give me this error ([Execute SQL Task] Error: Executing the query "INSERT INTO [SIT].[dbo].[ FileNameError] ([P..." failed with the following error: "Incorrect syntax near 'SIT'.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.)

and this is my insert statement "INSERT INTO [SIT].[dbo].[FileNameError] ([FileName],[ErrorCode] ,[ErrorDescription])
VALUES('"+ (DT_STR,255,1252) @[User::ErrFileName] +"'," + (DT_STR, 15, 1252) @[System::ErrorCode] + ",'" + (DT_STR, 1000, 1252) @[System::SourceName] + " :"+ (DT_STR, 1000, 1252) @[System::ErrorDescription] + "')"

plz help.

Regards LeeLuv
Post #1019093
Posted Thursday, November 11, 2010 9:19 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Friday, December 13, 2013 4:35 AM
Points: 386, Visits: 211
It's an expression. Probably the error is due to the values in the variables when it tries to evaluate the expression to produce the statement.


Cursors never.
DTS - only when needed and never to control.
Post #1019404
Posted Thursday, November 11, 2010 11:36 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Monday, June 23, 2014 5:28 AM
Points: 28, Visits: 174
Hi nigelrivett

thanx for ur help u are Right a added an Replace and is working fine now

"INSERT INTO [SIT].[dbo].[FileNameError] ([FileName],[ErrorCode] ,[ErrorDescription])
VALUES('"+ (DT_STR,255,1252) @[User::ErrFileName] +"'," + (DT_STR, 15, 1252) @[System::ErrorCode] + ",'" + REPLACE((DT_STR, 1000, 1252) @[System::SourceName] + " :"+ (DT_STR, 1000, 1252) @[System::ErrorDescription],"'","")+ "')"
Post #1019731
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse