ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories  >>  Software  >>  Databases  >>  SQL Server
 
 


 

 
 Oracle interview questions  Oracle Interview Questions
 SQL Server interview questions  SQL Server Interview Questions
 MS Access interview questions  MS Access Interview Questions
 MySQL interview questions  MySQL Interview Questions
 Postgre interview questions  Postgre Interview Questions
 Sybase interview questions  Sybase Interview Questions
 DB Architecture interview questions  DB Architecture Interview Questions
 DB Administration interview questions  DB Administration Interview Questions
 DB Development interview questions  DB Development Interview Questions
 SQL PLSQL interview questions  SQL PLSQL Interview Questions
 Databases AllOther interview questions  Databases AllOther Interview Questions
Question
How do you find the number of rows in a table?
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: How do you find the number of rows in a table?
Answer
# 1
select count(*) from tablename.
 
Is This Answer Correct ?    11 Yes 0 No
Hokar
 
  Re: How do you find the number of rows in a table?
Answer
# 2
Hokar, You are right. But using count(*) is not optimal.

I wud suggest going for sysindexes table to find the number 
of rows in a particular table.

SELECT rows FROM sysindexes WHERE id = OBJECT_ID
('table_name')
 
Is This Answer Correct ?    4 Yes 2 No
Uma Lakshman
 
 
 
  Re: How do you find the number of rows in a table?
Answer
# 3
Select Rows From SysIndexes Where Id = Object_Id
('tablename') And IndId<2

Uma Lakshman answer is wrong.

It Is Correct Answer

By
Kumar.T
 
Is This Answer Correct ?    5 Yes 1 No
Kumar.t
 
  Re: How do you find the number of rows in a table?
Answer
# 4
select @@rowcount
select count(*) from tablename
 
Is This Answer Correct ?    3 Yes 1 No
Elumalai.k
 
  Re: How do you find the number of rows in a table?
Answer
# 5
the question is how do find number of rows in a table?

select count(*) from table_name

by using this we will get exact number of rows in a table.
 
Is This Answer Correct ?    4 Yes 0 No
Raghuram
 

 
 
 
Other SQL Server Interview Questions
 
  Question Asked @ Answers
 
How to write a script for upate the data in prod , i have 50000 row are there TCS2
What is SQL Profiler what is the use of it? 247Customer2
why cluster and non clusterindex are used in sqlserver 2000? explain with example  1
what is the output for this query select * from employee where 1=1;  4
can you any body tell me simple recovery,full recovery,bulk logged recovery where can use?  1
Hi Can any one tell me the Good institute to learn SQL esp for Data Base Testing or SQL from scratch to the proficiency level in Hyederabad and facult also. Thankyou well in advance  6
can you any body tell me the difference between candidate key and primary key  4
What is an index? Yardi-Software7
What is a trigger?  3
What is the difference between DTS and SSIS? Allianz3
How can your resolve deadlocks? IBM3
How to link up the text file to a Database table? Allianz1
How do I list the available tables in a database I'm querying?  3
How do you check the performance of a query and how do you optimize it?  1
what is curser.  9
event classes in sql server Accenture1
write the query for taking database restore in sql?  2
Rate yourself in .NET and SQL ? Cognizent1
SYNTAX FOR VIEWS WITH EXAMPLE HOW TO LINK TWO TABLES Microsoft1
1.what is the difference between view and cursor? 2.If we do any change in view will it affect the database,similarly when we do changes in cursor will it affect the databse?with certain example?Thanks  3
 
For more SQL Server Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com