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

What is mssql?

0 Answers  


Explain the functionalities that views support?

0 Answers  


How to delete a login name in ms sql server?

0 Answers  


What is table level trigger?

0 Answers  


What is optimistic concurrency?

0 Answers  






CREATE TABLE [dbo].[HPMS_CompetencyTypes](CompetencyType varchar(50) ) go create trigger hpms_create_Insert on HPMS_CompetencyTypes for insert as if Exists ( select * from [HPMS_CompetencyTypes] where CompetencyType=(select * from [HPMS_CompetencyTypes])) begin Rollback tran Raiserror ('duplicate value',12,6) go insert HPMS_CompetencyTypes (CompetencyType) values ('new') I'm new to trigger can any one tell me where is the issue. Please.

2 Answers  


What is candidate key with example?

0 Answers  


What is the contrast between sql and mysql?

0 Answers  


What is difference between delete and truncate commands?

0 Answers  


What are the type of Indexes? which one is best, why?

6 Answers  


Tell me what is a linked server?

0 Answers  


What happens if strings are casted into wrong code pages in ms sql server?

0 Answers  


Categories