Document tasks gives incorrect syntax near ‘-‘
All,
I created a document task to run when a document fails as part of an integration for Cash Receipts for Dynamics GP. No matter what variation I try to update the SQL table, I the message Incorrect syntax near ‘-‘. _Source_ID is a bigint in my target table. I have selected _Source_ID as a bigint, but I still cannot get past this message. As a last resort, I declared a new variable and set the type as bigint and still receive the exact same message. Any ideas…
DECLARE @FailedIntegration BIGINT = (select lookup_Value_ID from [CARS].[SGEAS_DIFF].[dbo].Ref_lookup_value where value_description = ‘Failed to move to GP’)
DECLARE @CARSSource bigint = ‘_Source_ID’
UPDATE [CARS].[SGEAS_DIFF].[dbo].[Payment_Received]
SET GP_Integration_Status_ID = @FailedIntegration, Updated_Date = GETDATE(), Updated_By = ‘fsappuser’
WHERE Payment_Received_ID = @CARSSource
I created a document task to run when a document fails as part of an integration for Cash Receipts for Dynamics GP. No matter what variation I try to update the SQL table, I the message Incorrect syntax near ‘-‘. _Source_ID is a bigint in my target table. I have selected _Source_ID as a bigint, but I still cannot get past this message. As a last resort, I declared a new variable and set the type as bigint and still receive the exact same message. Any ideas…
DECLARE @FailedIntegration BIGINT = (select lookup_Value_ID from [CARS].[SGEAS_DIFF].[dbo].Ref_lookup_value where value_description = ‘Failed to move to GP’)
DECLARE @CARSSource bigint = ‘_Source_ID’
UPDATE [CARS].[SGEAS_DIFF].[dbo].[Payment_Received]
SET GP_Integration_Status_ID = @FailedIntegration, Updated_Date = GETDATE(), Updated_By = ‘fsappuser’
WHERE Payment_Received_ID = @CARSSource
Lamario,
Looking at your script I don’t see the issue. Usually when a SQL task is failing, I will run a SQL trace while the map is running to see exactly what command is being sent to SQL. This should make it clear why it is failing.