SQLServer modify the database field type

 

 

# Modify the field name to a temporary field exec sp_rename ' data_config.description ' , description1, ' COLUMN ' ;
 
# Create a new field and set it to the target format
alter table data_config add description text ;
# Save the value in the temporary field to the new field
update data_config set description = description1;
# delete temporary field
alter table data_config drop column description1;

 

Guess you like

Origin www.cnblogs.com/Leechg/p/12696938.html