﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2008 / T-SQL (SS2K8)  / Count the rows SQL Server 2005 / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Fri, 24 May 2013 10:47:51 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Count the rows SQL Server 2005</title><link>http://www.sqlservercentral.com/Forums/Topic887195-392-1.aspx</link><description>[quote][b]The Dixie Flatline (3/23/2010)[/b][hr]True, but then you create headaches for the poor, struggling UI developer who has to learn how to handle two different types of output from a single procedure.   ;-)[/quote]In my experience, UI developers are happier* to learn about OUTPUT parameters than to use MARS.Turning a parameter into an OUTPUT parameter generally involves just specifying its direction in an existing .NET statement.[hr][i]* = also, if they want to use my database, they will do it my way :laugh: :laugh: :laugh:[/i]</description><pubDate>Tue, 23 Mar 2010 07:35:26 GMT</pubDate><dc:creator>Paul White</dc:creator></item><item><title>RE: Count the rows SQL Server 2005</title><link>http://www.sqlservercentral.com/Forums/Topic887195-392-1.aspx</link><description>True, but then you create headaches for the poor, struggling UI developer who has to learn how to handle two different types of output from a single procedure.   ;-)</description><pubDate>Tue, 23 Mar 2010 06:44:21 GMT</pubDate><dc:creator>The Dixie Flatline</dc:creator></item><item><title>RE: Count the rows SQL Server 2005</title><link>http://www.sqlservercentral.com/Forums/Topic887195-392-1.aspx</link><description>[quote][b]WangcChiKaBastar (3/22/2010)[/b][hr]I have to write a sp that would give two data sets...[/quote]It is usually more efficient to just return one data set, and return the row count in an output parameter.</description><pubDate>Tue, 23 Mar 2010 04:16:25 GMT</pubDate><dc:creator>Paul White</dc:creator></item><item><title>RE: Count the rows SQL Server 2005</title><link>http://www.sqlservercentral.com/Forums/Topic887195-392-1.aspx</link><description>Nice sample and explanation Dave and Bob.</description><pubDate>Mon, 22 Mar 2010 13:19:37 GMT</pubDate><dc:creator>SQLRNNR</dc:creator></item><item><title>RE: Count the rows SQL Server 2005</title><link>http://www.sqlservercentral.com/Forums/Topic887195-392-1.aspx</link><description>Dave's right.    Here's a good practice tip:    @@ROWCOUNT changes with each new SET or SELECT, so if you want to hold on to the value for a while, be sure to store it in the variable of your choice.[code]-- always returns a @@ROWCOUNT of 1, because of the SET statementdeclare @DoNothing intselect name from sys.databases	SET @DoNothing = 1select @@ROWCOUNT as rowsReturnedgo-- saves the rowcount in @RC for later referencedeclare @rc intdeclare @DoNothing intselect name from sys.databasesSET @rc = @@ROWCOUNT -- save for later	set @DoNothing = 1select @rc as rowsReturned[/code]</description><pubDate>Mon, 22 Mar 2010 12:13:10 GMT</pubDate><dc:creator>The Dixie Flatline</dc:creator></item><item><title>RE: Count the rows SQL Server 2005</title><link>http://www.sqlservercentral.com/Forums/Topic887195-392-1.aspx</link><description>have a look at @@rowcount in BOL (Books On Line) [url]http://msdn.microsoft.com/en-us/library/ms187316.aspx[/url]</description><pubDate>Mon, 22 Mar 2010 02:14:45 GMT</pubDate><dc:creator>Dave Ballantyne</dc:creator></item><item><title>Count the rows SQL Server 2005</title><link>http://www.sqlservercentral.com/Forums/Topic887195-392-1.aspx</link><description>I have to write a sp that would give two data sets one with the coumns (metadata) like firstname, lastname, address, phonenumberand then second result set would return just the count of the rowscount(*) of the above selectplease advise</description><pubDate>Mon, 22 Mar 2010 01:36:22 GMT</pubDate><dc:creator>WangcChiKaBastar</dc:creator></item></channel></rss>