Search code examples
sql-serverssisdelimiterflat-filetilde

Tilde (~) Delimited File Read in SSIS


I'm trying to load a Tilde (~) delimited .DAT to SQL Server DB using SSIS. When I use a flat file source to read the file, I don't see the option of a ~ delimiter. I'm pasting a row from my file below:

7318~97836: LRX PAIN MONTHLY DX~001~ALL OTHER NSAIDs~1043676~001~1043676~001~OSR~401~01~ORALS,SOL,TAB/CAP RE~156720~50MG~ANSAID~100 0170-07

In here, I need to get the data between the columns separated by a ~ i.e. Column 1 should have '7318', Column 2 should have '97836: LRX PAIN MONTHLY DX'.

Can someone help me with this? Can this be done using a Flat File Source or do I need to use a Script Task?


Solution

  • Sure you can, you just need to configure the "Column delimiter" property in the "Flat File Connection Manager Editor". There are some predetermined choices there, but you can click and type any separator you want:

    enter image description here

    After that you can click "refresh" and then "OK".