SQL alter column datatype from nvarchar to int
问题 Can the datatype of a field be changed to int from nvarchar?? alter table employee alter column designation int is this valid?? If not can it be done in some other way?? P.S: I am using MS SQL Server 回答1: You can try doing an alter table. If it fails do this: Create a new column that's an integer: ALTER TABLE tableName ADD newCol int; Select the data from the old column into the new one: UPDATE tableName SET newCol = CAST(oldCol AS int) ; Drop the old column 回答2: It is possible only when you