SQL Expressions
In this article, you will learn how to use SQL expressions in conjunction with table and field assignments in the Aident SQL Migration app in Business Central.
What's the purpose of the function?
By integrating SQL expressions, complex statements can be executed during migration. For example, additional conditions can be created or values from other table fields can be fetched or checked.
The ability to set SQL expressions is possible in the table assignments (source table conditions only), table part assignments (source table conditions only) and field assignments.
SQL expressions in table assignments
Follow these steps to add SQL expressions in table assignments:
- Navigate to Database Assignments
- In Business Central, search for and go to the
Database Assignments
page.
- In Business Central, search for and go to the
- Open Database Assignment
- Open the database assignment for which the SQL expression should be added. The Database Assignment Card page opens.
- Open Table Assignment
- Open the table assignment for which the SQL expression should be added. The Table Assignment Card page opens.
- Add SQL expression
- Enter a SQL expression in Source Table Condition or Source Table Condition 2 in the Settings FastTab.
- Click the AssistEdit button to display an overview of possible SQL expressions and associated examples. The SQL Expressions page opens.
- Select an example and click OK to apply it. The expression is adopted and can then be adjusted.
SQL expressions in field assignments
Follow these steps to add SQL expressions in field assignments:
- Navigate to Database Assignments
- In Business Central, search for and go to the
Database Assignments
page.
- In Business Central, search for and go to the
- Open Database Assignment
- Open the database assignment for which the SQL expression should be added. The Database Assignment Card page opens.
- Open Table Assignment
- Open the table assignment for which the SQL expression should be added. The Table Assignment Card page opens.
- Add SQL expression
- Set Field Assignment Type to Expression in the Field Assignments SubPage.
- Enter an SQL Expression or SQL Expression 2 in the Field Assignments SubPage.
- Click the AssistEdit button to display an overview of possible SQL expressions and associated examples. The SQL Expressions page opens.
- Select an example and click OK to apply it. The expression is adopted and can then be adjusted.
SQL expressions in table part assignments
Adding SQL expressions to table part assignments is described in the Table Part Assignments feature.