Check udf computed columns Failed
The problem:
- The computed columns which use User-defined functions are converted to base type by our product.
-
This can lead to 'pre-migration-validation' failures, which you can find in the pre-migration-validation summary as:
Check udf computed columns Failed
-
If you check the full pre-migration-validation report, you’ll find failures like:
{
"error_type": "Check udf computed columns Failed",
"error_message": "Column '<column_name>' of table <table_name>
is a computed column which uses a Scalar User defined function.
These columns will be converted to base data types in the
target DB, if continued."
} - After unchecking the pre-migration-validation field you can continue this migration with the limitation.
How to handle post-migration:
-
For each of the above occurrences, you can handle this by re-creating the columns as desired computed columns in the target database. Follows these steps as detailed in the provided external links regarding the re-creation of columns as computed columns:
-
Preserve the old data:
EXEC sp_rename 'MyTable.OldCol', 'RenamedOldCol', 'COLUMN';
-
Add computed column:
ALTER TABLE MyTable ADD ComputedCol AS (some expression);
-
Finally, after validating the computed data, you can drop the preserved column from step 1:
ALTER TABLE MyTable DROP COLUMN RenamedOldCol;
-