Using query analyzer, name 3 ways you can get an accurate
count of the number of records in a table?




Answers were Sorted based on User's Feedback



Using query analyzer, name 3 ways you can get an accurate count of the number of records in a table..

Answer / kumar.t

1. Select Count(EmployeeId) As NoOfRow From Employee
2. Select Count(*) As NoOfRow From Employee
3. Select Count_Big(*) As NoOfRow From Employee
4. Select Rows From SysIndexes Where Id = Object_Id
('Employee') And IndId<2

By
Kumar.T

Is This Answer Correct ?    12 Yes 5 No

Using query analyzer, name 3 ways you can get an accurate count of the number of records in a table..

Answer / madhu

To get the total record count of a table use

Select count(*) from table_name
or
select count(column_name) from table_name

Is This Answer Correct ?    8 Yes 2 No

Using query analyzer, name 3 ways you can get an accurate count of the number of records in a table..

Answer / mathan

1.select count(*) from <table name>
2.select count_big(*) from <table name>
3.select rows from sysindexes where id=?

Is This Answer Correct ?    7 Yes 3 No




Using query analyzer, name 3 ways you can get an accurate count of the number of records in a table..

Answer / ramakrishna

count()
@@rowcount
sysindexes
dbcc chektable
sp_spaceused

excution plan

Is This Answer Correct ?    2 Yes 3 No

Using query analyzer, name 3 ways you can get an accurate count of the number of records in a table..

Answer / mahmood

1) Select count(*) from tablename

2) sp_spaceused tablename

3) Select id from sysobjects where name ='tablename'
GO
Select * from sysindexes where id=? ---Put ID no. from
above query

Is This Answer Correct ?    1 Yes 4 No

Post New Answer



More SQL Server Interview Questions

Why we are using the sql language?. What is the purpose of using this?

2 Answers  


What is a trigger?

4 Answers  


hi, the following are the outputs of sp_spaceused and sp_tempdbspace sp_spaceused ------------ database size unallocated size tempdb 77752.95 MB 28026.99 MB sp_tempdbspace ------------- database size spaceused tempdb 77752.945312 1.007812 the unused space in sp_spaceused is nearly 28 Gb and in sp_tempdbspace is nearly 76 Gb cany any one explain about this output and why its giving different results.

0 Answers  


What is the joins and how many types of Joins in sql server a diffrentiate ever one give a suaitable query

2 Answers   Apollo,


What is the system function to get the current user's user id?

3 Answers   TCS,






what is differece between union and union all

6 Answers  


Explain Capacity planning to create a database? and how to monitor it?

0 Answers  


i need some interview questions on sql server developer plz any onee send some links.

2 Answers  


When do u use clustered index and non-clustered index?

3 Answers   IBM,


What is the difference between DTS and SSIS?

3 Answers   Allianz,


why SQL server is more used to store database rather than Access

2 Answers  


check, not null,unique

2 Answers   IBM,






Categories