在sql server中的循环类型? [英] type of loops in sql server?

查看:118
本文介绍了在sql server中的循环类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

解决方案

请告诉我在SQL Server 2008中可以使用的所有种类的循环。 p>你应该避免循环,当你可以尝试找到一个基于集合的方法。



这里有一篇文章描述了为什么:



http://www.techrepublic.com/blog/datacenter/avoiding- cursors-with-sql-server-2005/412



如果你真的需要循环:



http: //www.techrepublic.com/blog/datacenter/comparing-cursor-vs-while-loop-performance-in-sql-server-2008/1741


Please tell me the all kind of loops that we can use in SQL Server 2008. Example of each would be good.

解决方案

You should avoid loops when you can, try to find a set based approach. You'll get more performance that way.

Here's an article describing why:

http://www.techrepublic.com/blog/datacenter/avoiding-cursors-with-sql-server-2005/412

If you really need loops:

http://www.techrepublic.com/blog/datacenter/comparing-cursor-vs-while-loop-performance-in-sql-server-2008/1741

这篇关于在sql server中的循环类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆