After generating a flat file in SSIS I needed to update that file with the column headers as the first row. In order to do this I used a SQL stored procedure. STEP 1 : Run the code below to create the stored procedure. USE MIGRATION_DB IF OBJECT_ID( 'GenerateBCPforSSIS' ) IS NOT NULL DROP PROC GenerateBCPforSSIS GO CREATE PROCEDURE GenerateBCPforSSIS ( @db_name varchar (1000), @table_name varchar (1000), @file_name varchar (1000) ) AS Declare @Headers varchar ( MAX ),@HeadersRaw varchar ( MAX ),@ sql varchar ( MAX ), @header_file varchar ( MAX ), @filename_short varchar ( MAX ) --Generate column names as a recordset Select @Headers = IsNull(@Headers + ',' , '' ) + '""' + Column_Name + '""' From INFORMATION_SCHEMA.COLUMNS Where Table_Name = @table_name ORDER BY ORDINAL_POSITION ASC -- Create a dummy file to have header data select @header_file= substring (@file_name,1,len(@file_name)-charindex( '\...