I am working on a project that has a C# front end that will be used to select a file for importing into an MSSQL SQL Database. In the table there will be an additional column called 'recommendedAction' (tinyint - 0-5 only)

I would like to have sql fill in the 'recommendedAction' column based on criteria in a different table.

Is there a way that when SQL is importing (SSIS or pure TSQL) it could read the values of a table and fill in the 'action' based on the criteria? Or is this something that should be done in the C# frontend?

**EDIT**

SQL table structure for imported data (with additional column)

```
Create Table ImportedData (
Column1 INT Identity,
Column2 VARCHAR(10) NOT NULL,
Column3 CHAR(6) NOT NULL,
RecommendedAction TINYINT NOT NULL
)

```

Table structure of recommended action criteria

```
Create Table RecommendedActions(
ID INT Identity,
ActionID TINYINT NOT NULL, --value to put in the RecommendedAction column if criteria is a match
CriteriaColumn VARCHAR(255) NOT NULL --Criteria to match against the records
)

```

Example records for RecommendedActions

```
ID    ActionID    CriteriaColumn
1     2           'Column2 LIKE ''6%'''
2     3           'Column2 LIKE ''4%'''

```

Now when a new set of data is imported, if Column2 has a value of '6032' it would fill in a RecommendedAction of 2