Changing column data type in existing DB

Hi everyone!

I created an SQL database but forgot to change the column types from varchar to decimal.
I don’t want to rebuild the whole database, but only change the columns.
Is there any way to do it with KNIME?
Like DB connection - Query reader - String to number - DB writer ?

Will this replace the existing columns or write in new ones?

Thanks in advance!

Hi @LBence and welcome to the Knime Community.

You an just execute an ALTER TABLE sql statement. You can run this via any client. In Knime, you can execute it via the DB SQL Executor.

The syntax for SQL Server is:
ALTER TABLE table_name
ALTER COLUMN column_name datatype ;

5 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.