Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

dynamic bulk load

$
0
0

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



Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>