You are here: Re: Loop / Cursor help « MsSQL Server « IT news, forums, messages
Re: Loop / Cursor help

Posted by Erland Sommarskog on 02/23/06 01:29

Madhivanan (madhivanan2001@gmail.com) writes:
> Why does select * from @t returns 32 rows?
> I expected it to return 28 rows only

Watch this part of the output:


(1 row(s) affected)


(1 row(s) affected)


(2 row(s) affected)


(4 row(s) affected)


(8 row(s) affected)


(16 row(s) affected)

See what is going on? David is doubling the number of rows he inserts
each time. That way the loops can run fewer iterations and be faster.



--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация