摘要: 1)禁止所有表约束的SQLselect 'alter table '+name+' nocheck constraint all' from sysobjects where type='U'2)删除所有表数据的SQLselect 'TRUNCATE TABLE '+name from sysobjects where type='U'3)恢复所有表约束的SQLselect 'alter table '+name+' check constraint all' from sysobj 阅读全文
posted @ 2012-12-06 11:56 LGWCICI 阅读(178) 评论(0) 推荐(0) 编辑
摘要: 1、查找表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断select * from peoplewhere peopleId in (select peopleId from people group by peopleId having count(peopleId) > 1) 例二: select * from testtable where numeber in (select number from people group by number having count(number) > 1 ) 可以查出testtable表中number相同的记录.. 阅读全文
posted @ 2012-12-06 11:43 LGWCICI 阅读(109) 评论(0) 推荐(0) 编辑