Reputation: 63
I have hard coded values in one of the table
And I am passing this column as a parameter and try to delete some values .The below is mentioned querie:
DELETE FROM [S4].[@{pipeline().parameters.DESTINATION_TABLE_NAME}] WHERE ERDAT >='@{item().LastLoadDate}' OR @{pipeline().parameters.WHERE_SQL} >='@{item().LastLoadDate}
I am getting error :
ErrorCode=SqlOperationFailed,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=A database operation failed with the following error: 'Incorrect syntax near '>'.',Source=,''Type=System.Data.SqlClient.SqlException,Message=Incorrect syntax near '>'.,Source=.Net SqlClient Data Provider,SqlErrorNumber=102,Class=15,ErrorCode=-2146232060,State=1,Errors=[{Class=15,Number=102,State=1,Message=Incorrect syntax near '>'.,},],'
Please advise.
Regards Rohit
Upvotes: 0
Views: 155
Reputation: 6114
where_sql
column also has null values. When you try to use one of these values in the query, the error occurs.where_sql
column. I used a look up activity to get these values.delete from demo where idt>='2023-04-01' or @{item().where_sql}>='2023-04-01'
where_sql
column value is null thus leaving you with the required column names to query with.Upvotes: 0