摘要: count(*) 查出来的是:结果集的总条数 count(字段名) 查出来的是: 结果集中‘字段名’不为空的记录的总条数 阅读全文
posted @ 2017-01-05 11:35 不忘初心de博客 阅读(1607) 评论(0) 推荐(0) 编辑
摘要: 删除主键 alter table 表名 drop constraint 主键名 删除之前先查询下系统表中的主键 select* from sysobjects where xtype ='pk ' 添加主键 alter table 表名 add primary key (字段名) alter tab 阅读全文
posted @ 2017-01-04 17:02 不忘初心de博客 阅读(2636) 评论(0) 推荐(0) 编辑
摘要: alter table [表名] alter column [字段名][ 属性] 例子: 把Student表中Sno的int类型 修改为 varchar 类型 alter table Student alter column Sno varchar(20) not null 阅读全文
posted @ 2017-01-04 16:48 不忘初心de博客 阅读(4990) 评论(0) 推荐(0) 编辑