In my Sink I'm running a Pre SQL Script to delete data after a certain date but I'm having trouble using parameters in the script.
Here is my date parameter variable inside dataflow and below is my pipeline parameter and SQL script
DELETE FROM dbo.DAP_WD_Timecard_Analysis_Test WHERE Reported_Date > '{$date}'
This is the error I'm receiving below. I've tried using a Date type instead of String with the same result. This works when I hard code the date.
To resolve the above error, you can use the below expression in the pre-copy scripts. Your parameter data type should be string.
concat('delete from dbo.table1 where mydate >','\'',$date_param,'\'')
Open the expression builder and give the above expression.
This is my input data before dataflow execution:
You can see after the dataflow execution the mentioned rows were deleted. Here, I have used the same table as source and sink in dataflow so there will be duplicates in my case which you can ignore.