You are here: Count the number of rows in a UNION ALL statement « MsSQL Server « IT news, forums, messages
Count the number of rows in a UNION ALL statement

Posted by markjerz on 01/08/07 15:15

Hi,

Should be quite simple but can someone please tell me the best way to
count the number of rows in an UNION ALL statement.

I tried using @@ROWCOUNT but that doesn't seem to contain the correct
number.

Also, I assume that running the query again but just returning count(*)
instead of the data is horribly inefficient (plus the code is then
bloated.)?

Thanks,
Mark

 

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

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