Convert bit column to integer

Viewed 94741

I am converting bit columns of a particular table to integer through an SQL script (this table has some default constraints for default value).

I have to alter the columns for the table, not runtime casting, What script can be used to accomplish this?

8 Answers

None of the provided solutions worked for me. I had to used Signed or Unsigned instead of INT e.g.

SELECT columnName, CAST(columnName AS SIGNED) AS IntValue FROM table

Hope this helps for new users.

Related