Category / Section
How to Change Column Data Type in Code View Mode for MS SQL and Postgre SQL connections
Published:
In Code View mode, you can change the data type of a column using different methods depending on the data source you are using. Here, we provide examples for Microsoft SQL and PostgreSQL data sources.
Microsoft SQL
To convert a string to an int in a Microsoft SQL data source, use the following syntax:
CONVERT(datatype, Column_name)
Alternatively, you can use an expression to achieve the same result.
PostgreSQL
To convert a string to an int in a PostgreSQL data source, use the following syntax:
CAST(Column_name AS INT)
For a PostgreSQL data source, you can also use an expression to convert the data type.