I have a table in my SQL Server DB.
CREATE TABLE [dbo].[Table2]([col3] [varchar](50) NULL, [col4] [varchar](50) NULL, [col5] [char](1) NULL)
Following is the data in the table:
col3 col4 col5
sad asdf c
df sdfg b
Now I want to change the datatype of 'col5' to INT. Tried this:
alter table [dbo].[TABLE2] alter column [col5] int null;
Encountered this error:
Conversion failed when converting the varchar value 'c' to data type int.
The statement has been terminated.
After changing the datatype to INT - I want to change 'c' to 100 and 'b' to 101.
How can I change the datatype and the data? Please point me in the right direction.