A new feature was added to the Raw File Destination in SQL Server 2012 which allows you to output an empty raw file from the editor UI.
- Add a Raw File Destination to your data flow, and connect it to the previous transform
- Double click to open the Raw File Destination Editor
- Configure the file name
- Click on the Columns tab, and select the columns you want included
- Click on the Connection Manager tab
- Click the Generate initial raw file … button
- A dialog confirming the output columns will pop up. Click OK to create your file.
This functionality is handy when you are using raw files to stage data between data flows. You can use this empty raw file in the Raw File Source to configure the metadata it needs. In previous versions, you would have had to run the package to produce the initial file.
Another note – Raw Files were improved in SQL Server 2012 to include sort information, so now the IsSorted flag is automatically set in the Raw File Source.