declare cursor_insert scroll cursor for select * from 你的表 open cursor_insert fetch ABSOLUTE 80000 from cursor_insert close cursor_insert deallocate cursor_insert
错了错了,是80000条,不是80000万条。 只要有select top 80000 tlid from bookinfo order by tlid,语句的效率就不会高到哪里去,这样不行。 TO大力:你的方法可行。我在SQL2K+10万条数据下测试,每次耗时1026ms;用我给出的方法,第一次运行耗时3024,以后运行,每次耗时在300ms左右。可见各有优缺点,怎样进一步提高你的方法的运行速度?(能否不要 select * from 你的表,这一句太费资源了)
open cursor_insert
fetch ABSOLUTE 80000 from cursor_insert
close cursor_insert
deallocate cursor_insert
只要有select top 80000 tlid from bookinfo order by tlid,语句的效率就不会高到哪里去,这样不行。
TO大力:你的方法可行。我在SQL2K+10万条数据下测试,每次耗时1026ms;用我给出的方法,第一次运行耗时3024,以后运行,每次耗时在300ms左右。可见各有优缺点,怎样进一步提高你的方法的运行速度?(能否不要 select * from 你的表,这一句太费资源了)