File Group Pattern (Model Object)
Applies to
Platform: Microsoft SQL Server
Architecture: Stage
File Group Pattern (FileGroupPattern) selects the files that the raw data loader reads for a Source. The pattern follows the source object name, so with the default * the loader reads every file whose name starts with the source object name and ends with the File Extension.
The property exists only in the Microsoft SQL Server Stage File generator. There, the raw data loader is the procedure that reads the files of a Stage into its raw data table.
Where to set it
Set File Group Pattern when you edit a model object of type Source. It is a text field.
How the loader selects files
- The loader lists the files of the source folder with the Windows
dircommand and the pattern<source object name><File Group Pattern><File Extension>, sorted by name. - It keeps the names that start with the source object name.
- It loads the files one after another, in name order, into the raw data table of the Stage.
The wildcards * and ? follow the rules of the Windows dir command. These rules include the short 8.3 names that Windows creates for long file names.
The pattern starts after the source object name. With *, a source object named ITEM also loads files of a source object named ITEM_OFFER.
Values
*: every file that starts with the source object name and has the File Extension.- Empty: only the file
<source object name><File Extension>. - Another pattern with
*or?: the files that match it after the source object name.
Default value
*.
Example
The source folder holds these files:
ITEM.csv ITEM.txt ITEM_2024.csv ITEM_OFFER.csv ITEMS.csv OTHER.csv
The Source ITEM has File Group Pattern * and File Extension .csv. The loader lists the files with DIR "<source folder>ITEM*.csv" and loads ITEM.csv, ITEM_2024.csv, ITEM_OFFER.csv and ITEMS.csv, in this order. It does not load ITEM.txt, which has another extension, or OTHER.csv, which starts with another name.
With an empty File Group Pattern, a Source CUSTOMER loads only CUSTOMER.csv and leaves CUSTOMER_2024.csv in the source folder.
Related articles
- Reference: File Extension (Model Object)
- See also: Microsoft SQL Server - Target environment, Model a Stage File Solution, Microsoft SQL Server - Stage Files