SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 numbers of rows
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

inbs
Aged Yak Warrior

834 Posts

Posted - 11/22/2010 :  00:57:11  Show Profile  Reply with Quote
how can i see the numbers of rows in my query (ssms)


like:

1 SELECT *
2 FROM TABLEA
3 WHERE a>b and
4 c>d

AndrewMurphy
Flowing Fount of Yak Knowledge

Ireland
2916 Posts

Posted - 11/22/2010 :  04:50:08  Show Profile  Reply with Quote
a) SELECT count(*) FROM TABLEA WHERE a>b and c>d
b) use the recordset.recordcount property. in VB this is only available for certain recordset types (and there is a performance downside to using those types)....otherwise you have to count the records yourself in the returned recordset.

Go to Top of Page

webfred
Flowing Fount of Yak Knowledge

Germany
8764 Posts

Posted - 11/22/2010 :  04:50:22  Show Profile  Visit webfred's Homepage  Reply with Quote
In the right lower corner of your query window you can see the number of rows returned by your query.
If that isn't what you want to know then be more specific please.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

inbs
Aged Yak Warrior

834 Posts

Posted - 11/22/2010 :  05:04:44  Show Profile  Reply with Quote
see the example i wrote:

1 SELECT *
2 FROM TABLEA
3 WHERE a>b and
4c>d

i want to see the number of rows in the code in management studio
Go to Top of Page

webfred
Flowing Fount of Yak Knowledge

Germany
8764 Posts

Posted - 11/22/2010 :  06:08:04  Show Profile  Visit webfred's Homepage  Reply with Quote
This is one way:
SELECT
COUNT(*) OVER (PARTITION by (SELECT 1)) as numrows,
*
FROM TABLE
WHERE ...


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

inbs
Aged Yak Warrior

834 Posts

Posted - 11/22/2010 :  07:08:07  Show Profile  Reply with Quote
i thinks that is something in "properties"

i see it in some examples but i do not find where it is
Go to Top of Page

Bustaz Kool
Flowing Fount of Yak Knowledge

USA
1673 Posts

Posted - 11/24/2010 :  12:34:20  Show Profile  Reply with Quote
Are you trying to get the line numbers to appear?

Tools -> Options -> Text Editor -> All Languages -> General -> Line Numbers checkbox

=======================================
No matter what side of the argument you are on, you always find people on your side that you wish were on the other. -Jascha Heifetz, violinist (1901-1987)
Go to Top of Page

webfred
Flowing Fount of Yak Knowledge

Germany
8764 Posts

Posted - 11/24/2010 :  16:30:11  Show Profile  Visit webfred's Homepage  Reply with Quote
OMG!
line numbers


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000