Hello,
At present in the ssis package, I have placed an Execute SQL Task which does the follwoing as a dynamic sql by passing in:
@TableName
@FullFilePath
set @SQL_Truncate = 'TRUNCATE TABLE ' + @TableName + ';';
set @SQL_Insert = @SQL_Truncate
set @SQL_Insert += ' BULK INSERT'
set @SQL_Insert += ' ' + @TableName
set @SQL_Insert += ' FROM'
set @SQL_Insert += ' ''' + @FullFilePath + ''''
print @SQL_Insert
exec sp_executesql @SQL_Insert;
Question:
This works fine but I would like to move away from the dynamic sql...
How can the above truncate and bulkload be done dynamically in ssis ?
note that each dynamic table has different column names.
Thank you