开发者

How can we write a a query without using temporary tables in detail explanation in SQL

I need the deep explanation for the queries that are not using the temporary tables in SQL Server 2008 and without using the cursors.

开发者_Python百科

Thanks, Vara Prasad.M


You want to use a variable table with an identity and iterate through it (also known as RBAR [Row By Agonizing Row]) over using a cursor for several reasons:

  1. Cursors lock the row - you can do more with a cursor such as moving backwards and updating but you're accessing your table
  2. Using a variable table keeps the data in memory which is faster than using a physical table
  3. Personally, I've been bitten too many times by forgetting to deallocate my cursor
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜