To modify the data type of a column:
Please note: Whenever making a change to a table structure there is a chance that change may result in data corruption if not done correctly, which is why it is would advisable to take a backup/copy of the table on which you intend to make the change. You can do this simply by running the following statement:
use nameofthedatabase
select * into dbo.name_of_the_table_backup from dbo.name_of_the_table
Using T-SQL
To change the data type of a column
In Object Explorer, connect to the desired server the table resides in
On the Standard bar, select New Query. Select the database in which the table resides by choosing from the drop-down on the top-left corner or
use name_of_database;
Copy and paste the following example into the query window and select Execute.
T-SQL:
ALTER TABLE name_of_table
ALTER COLUMN name_of_column datatype;
Using Object Explore/Graphical Interface:
In Object Explorer, right-click the table with columns you wish to amend the data type and select Design.
Select the column for which you want to amend the data type.
In the Column Properties tab, select the grid cell for the Data Type property and choose a new data type from the drop-down list.
On the File menu, select Save table name.
Note:
When you change the data type of a column, Table Designer applies the default length of the data type you selected, even if you have already specified another. Always set the data type length for to the desired value after specifying the data type.
Be thoughtful about the data type you are changing, if the data type is not applicable to data in the column, there are chances of data loss or data integrity.
Warning
If you attempt to change the data type of a column that relates to other tables, Table Designer asks you to confirm that the amendment should be made to the columns in the other tables.