I need to create a CSV file with a column delimiter of CTRL-A. Is that possible with the flat file destination? If it is, what's the syntax? If it isn't, is there a solution short of a custom destination?
2 Answers
I took a similar approach to sorrell, but my outcome was slightly different:
In SSMS, Create the character and copy the output. Note that this will look like nothing if you paste it anywhere.
SELECT char(1)
EDIT:
Make sure to copy the result of this query from the results window. You can confirm you have it by pasting into notepad - it will show the cursor move one space. or in notepad++, it will show a highlighted "SOH"
Here is where I found which decimal to use: http://www.unix-manuals.com/refs/misc/ascii-table.html
- Paste that value into the Column Delimiter of the flat file manager:
This is what the output looks like in Notepad:
More interestingly, this is what it looks like in Notepad++ (matching the Start Of Heading text - SOH from the ASCII table I posted a link to above:

- 4,287
- 1
- 17
- 25
-
The column delimiter reverts back to Comma {,} after saving. – Metaphor Jan 29 '15 at 16:19
-
Did you paste the value in with out the squiggly brackets? What version of SSIS are you using? – Mark Wojciechowicz Jan 29 '15 at 16:24
-
@Metaphor I just tested out, if you paste nothing in there, it will revert to a comma. Please make sure that you are copying the output from SSMS. I will update the post to show where this is being copied from. – Mark Wojciechowicz Jan 29 '15 at 16:35
-
Actually, it works. Apparently it always reverts back to a comma whenever you go back in there. Tried it with a vertical bar and it still shows a comma when you go back in. – Metaphor Jan 29 '15 at 19:28
-
Btw, looked in the dtsx and the ColumnDelimiter is "_x0001_" for each column. Should be able to edit that in the file directly. – Metaphor Jan 29 '15 at 19:33
-
What version of integration services are you using? – Mark Wojciechowicz Jan 29 '15 at 19:59
-
Using SSIS 2012, November patch. – Metaphor Jan 29 '15 at 20:27
-
@Metaphor I gave this a go in 10.50.4033.0 (2008 R2) and 11.0.3369.0 (2012) and both do not revert to "{,}" - that's really odd behavior. – Mark Wojciechowicz Jan 29 '15 at 20:48
I haven't fully tested this, but it seems doable.
Create a template flat file with the headings. I used Linqpad to create the Ctrl-A character using a unicode string (\u0001). You could also get there the ascii route using \x01 (same character, just pointing this out if you need to use it in code). Here's what's in my flat file.
ColumnA□ColumnB
Create a Flat File Destination, and create a New Flat File Connection. Select Delimited as the type.
- Browse to your flat file template, check the Unicode box (if unicode), and if the data should contain headers, check that box too.
- Copy the Ctrl-A character from your template and paste it into the Column delimiter box. Then click the Refresh button.
You should now be able to work with the delimited columns. If you need to manually recreate that character in code, you can always use \x01 or \u0001.

- 1,801
- 1
- 16
- 27