Advertisement

07.07.2008 at 04:27PM PDT, ID: 23545085
[x]
Attachment Details

@@ROWCOUNT and SELECT statements - I want to understand this

Asked by donpick in MS SQL Server

Tags: Microsoft, SQL server, 2000, Rowcount and SELECT

Running Small Business Server 2003 premium (SQL Server 2000).

My question :

When I want to loop through  records I have been creating temp tables with a record ID field in them and writing the data to the temp table.  Then I usually execute a SELECT stmt to determine the beginning recordID and the ending record ID.

I was wondering:  



1.)      After performing a SELECT, does @@ROWCOUNT contain the number of records returned by the SELECT statement?

2.)      Lets say I execute a SELECT statement having a clause like:
                 ORDER BY  field1 DESC

            Does the @@ROWCOUNT number the records in the order they are sorted?



The SQL Server online help is unhelpful on this topic.

Thanks for your help.
Start Free Trial
 
Keywords: @@ROWCOUNT and SELECT statemen…
 
Loading Advertisement...
 
[+][-]07.07.2008 at 04:34PM PDT, ID: 21949500

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: MS SQL Server
Tags: Microsoft, SQL server, 2000, Rowcount and SELECT
Sign Up Now!
Solution Provided By: chapmandew
Participating Experts: 4
Solution Grade: A
 
 
[+][-]07.07.2008 at 06:50PM PDT, ID: 21950145

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]07.07.2008 at 07:58PM PDT, ID: 21950472

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.08.2008 at 01:13PM PDT, ID: 21957769

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628