更改text类型为varchar(100)

alter table TABLENAME add NEWFIELD varchar(100)

update TABLENAME set NEWFIELD=OLDFIELD

alter table TABLENAME drop column OLDFIELD

exec sp_rename 'TABLENAME.NEWFIELD', 'OLDFIELD', 'COLUMN'

Published At
Categories with 数据库类
Tagged with
comments powered by Disqus