I following an SO question on how to truncate a table in Azure SQL DB with ADF how to replace data in azure sql database using azure data factory?
I am trying to emulate the sample in the question using my Copy Activity as follows:
My Source details are as follows:
With the above configuration I get the following error:
{
"errorCode": "2200",
"message": "ErrorCode=SqlOperationFailed,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=A database operation failed with the following error: 'Cannot find the object \"targettable\" because it does not exist or you do not have permissions.',Source=,''Type=System.Data.SqlClient.SqlException,Message=Cannot find the object \"targettable\" because it does not exist or you do not have permissions.,Source=.Net SqlClient Data Provider,SqlErrorNumber=4701,Class=16,ErrorCode=-2146232060,State=1,Errors=[{Class=16,Number=4701,State=1,Message=Cannot find the object \"targettable\" because it does not exist or you do not have permissions.,},],'",
"failureType": "UserError",
"target": "Copy From CRM to SQLDB",
"details": []
}
However, if I were to hardcode the schema and table name as follows TRUNCATE TABLE dbo.mytablename everything would work fine.
By way of an update, I just tried with the following parameters
TRUNCATE TableName@pipeline().parameters.TableName
And it failed.








TRUNCATE table @{pipeline().parameters.TableName}?