摘要: 第一种方法,先记录执行前的时间,然后在记录执行Sql后的时间,然后做减法 1 第一种方法: 2 declare @begin_date datetime 3 declare @end_date datetime 4 select @begin_date = getdate() 5 SELECT CO 阅读全文
posted @ 2016-04-26 17:50 蚂蚁撼大象 阅读(335) 评论(0) 推荐(0) 编辑
摘要: 具体要注意的: 1、应尽量避免在 where 子句中对字段进行 null 值判断,否则将导致引擎放弃使用索而进 行全表扫描,如:select id from t where num is null 可以在 num 上设置默认值 0,确保表中num列没有null值,然后这样查询:select id f 阅读全文
posted @ 2016-04-26 10:57 蚂蚁撼大象 阅读(319) 评论(0) 推荐(0) 编辑