文章分类 -  SQL Server

sql server中查找和删除重复记录的方法
摘要:在几千条记录里,存在着些相同的记录,如何能用SQL语句,删除掉重复的呢?1、查找表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断select * from peoplewhere peopleId in (select peopleId from people group by peopleId having count(peopleId) > 1) 2、... 阅读全文
posted @ 2007-01-31 13:09 BIS 阅读(414) 评论(0) 推荐(0)
清空SQL Server日志
摘要:经常碰到网站的SQL Server在使用一段时间后日志变得很大,发现在Sql Server的选项中选了自动收缩也没有用,终于找到一个办法可以清空日至。执行下面语句即可清空日志:backup log databasename with no_logdbcc shrinkdatabase(databasename, truncateonly) 阅读全文
posted @ 2005-06-20 14:39 BIS 阅读(556) 评论(0) 推荐(0)