sql执行时间

declare @i as int
declare @begintime as datetime
set @begintime = getdate()
set @i = 0

while @i < 100
begin

insert into TestT (title,info,flag) values ('title'+cast(@i as varchar),'info'+cast(ceiling(rand() * 100) as varchar ),ceiling(rand() * 2))
set @i = @i + 1

end

select datediff(ms,@begintime,getdate()) as '執行時間'


posted @ 2012-08-21 14:59  hanwest  阅读(200)  评论(0编辑  收藏  举报