When you read the message you can have the answer since it seems like a column of type varchar
(string) is being used where a numeric data type is expected for division.
You might cast a varchar
column to a numeric type in SQL:
SELECT
column1,
column2,
CAST(varchar_column AS float) AS numeric_column
FROM
your_table
If the division operation is part of a SQL query, ensure all operands are numeric:
SELECT
column1 / CAST(varchar_column AS float) AS result
FROM
your_table
If you're using ADF Data Flow, you can add a Derived Column transformation to cast the varchar
column to a numeric type:
- Derived Column Transformation:
- Add a Derived Column transformation to your data flow.
- Create a new column or replace the existing one with the cast expression, e.g.,
toFloat(varchar_column)
.
- Perform the Division Operation:
- Use the newly cast column in your arithmetic operations.