I have a SQL Server 2008 database. This database has a column that represents a “bit”. This bit flag now needs to be an int. My problem is, there is a already a lot of data in the table. Is there a way to easily do this conversion? Considering I’m using a larger data type, I don’t see the problem. However, the problem is the containing data. How do I map my bit fields to the corresponding int values all while changing the column type.
Thank you,
like this
change TableName to the name of your table and ColumneName to the name of your column
see also: When changing column data types use ALTER TABLE TableName ALTER Column syntax, don’t drop and recreate column