SQL语句修改字段类型
mysql中
alert table name modify column name type;
例子:修改user表中的name属性类型为varchar(50)
alert table user modify column name varchar(50);
Sqlserver中
alter table 表名 alter column 列明 type
例子:alter table tb_user alter column user_name varchar(60)
oracle中
alter table table_name alter column column_name new_data_type
例子:alter table tb_user alter column user_name varchar(60)
第一次SQLServer试验
create database BooksInfo use BooksInfo create table BookInfo( Bookid int, BookName varchar(50) NOT NULL, PublishMan char(30) NOT NULL, BookBuymoney numeric(5,2), bookbuytime datetime, BookYesNo bit ) create table LendInfo( UserId varchar(10), BookId int, LendTime datetime, backTime datetime, UserMoney money ) Alter table BookInfo add BookKind varchar(20) alter table BookInfo alter column BookBuymoney money Alter table BookInfo drop column PublishMan drop table BookInfo drop table LendInfo