Transforming Flat Files with Irregular Delimiters in SSIS
By Tom Nonmacher
When working with flat files in SQL Server Integration Services (SSIS), one of the most common challenges is dealing with irregular delimiters. An irregular delimiter is a character or sequence of characters that separates the fields in a flat file, but that may not be the same from one record to the next. In this blog post, we will discuss how to use SSIS to transform flat files with irregular delimiters.
The first step in handling irregular delimiters in SSIS is to identify what the possible delimiters are. For instance, in many cases, fields in a flat file may be separated by a comma, a space, a tab, or a semicolon. However, in some cases, the delimiter may be a sequence of characters, such as "::" or "|~|". Once you have identified the possible delimiters, you can then set up your SSIS package to recognize and handle these delimiters.
The Flat File Source component in SSIS is designed to handle regular delimiters. However, it can also be used to handle irregular delimiters by setting the property "TextQualified" to false, and specifying the irregular delimiter in the "ColumnDelimiter" property. This can be done using a SQL Server 2016 or 2017 T-SQL script. For example:
-- T-SQL code for SQL Server 2016 or 2017
-- Set TextQualified to false and ColumnDelimiter to irregular delimiter
UPDATE SSISDB.catalog.set_object_parameter_value @folder_name=N'Folder',
@project_name=N'Project',
@parameter_name=N'TextQualified',
@parameter_value=N'false';
UPDATE SSISDB.catalog.set_object_parameter_value @folder_name=N'Folder',
@project_name=N'Project',
@parameter_name=N'ColumnDelimiter',
@parameter_value=N'::';
In MySQL 5.7, the LOAD DATA INFILE statement can be used to import a flat file with irregular delimiters. The FIELDS TERMINATED BY clause allows you to specify the delimiter. For example:
-- MySQL 5.7 code
LOAD DATA INFILE 'data.txt' INTO TABLE tbl
FIELDS TERMINATED BY '|~|';
In DB2 11.1, the IMPORT command can be used to import a flat file with irregular delimiters. The DELIMITED BY clause allows you to specify the delimiter. For example:
-- DB2 11.1 code
IMPORT FROM 'data.txt' OF DEL MODIFIED BY COLDEL|~| METHOD P (1, 2, 3) INSERT INTO tbl;
In Azure SQL, the BULK INSERT statement can be used to import a flat file with irregular delimiters. The FIELDTERMINATOR clause allows you to specify the delimiter. For example:
-- Azure SQL code
BULK INSERT tbl
FROM 'data.txt'
WITH (FIELDTERMINATOR = '|~|');
In conclusion, while handling irregular delimiters in flat files can be a challenge, SSIS and various SQL technologies provide tools and techniques for dealing with this issue. By using the right combination of settings and commands, you can successfully import and transform flat files with irregular delimiters in SSIS.
Check out the latest articles from all our sites:
- How to Take Advantage of Flash Sales at Grocery Stores [https://www.ethrift.net]
- A brief history of the Galveston Hurricane of 1900 [https://www.galvestonbeachy.com]
- How to Plant and Maintain Chokeberry Bushes [https://www.gardenhomes.org]
- New Query Store Enhancements in SQL Server 2022 [https://www.sqlsupport.org]
- Heat: Why My Laptop Is Cooking My Lap [https://www.SupportMyPC.com]
- The Best Months to Visit South Korea for Cherry Blossoms and Fall Colors [https://www.treasureholidays.com]
Privacy Policy for sqlsupport.org
Last updated: Feb 03, 2026
sqlsupport.org respects your privacy and is committed to protecting any personal information you may provide while using this website.
This Privacy Policy document outlines the types of information that are collected and recorded by sqlsupport.org and how we use it.
Information We Collect
- Internet Protocol (IP) addresses
- Browser type and version
- Pages visited
- Time and date of visits
- Referring URLs
- Device type
Cookies and Web Beacons
sqlsupport.org uses cookies to store information about visitors preferences and to optimize the users experience.
How We Use Your Information
- Operate and maintain our website
- Improve user experience
- Analyze traffic patterns
- Prevent fraudulent activity
Contact
Email: admin@sqlsupport.org