What is the datatype returned by count(*)

Answer Posted / lakshmi narayanan r

It will return INT. Proof is here...
SELECT COUNT(*) AS Total INTO tmpArchiveStoreMaster1 FROM
ArchiveStoreMaster asm
GO
sp_help tmpArchiveStoreMaster1

Name

Owner

Type
Created_datetime
--------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------
------------------------------- -----------------------
tmpArchiveStoreMaster1

dbo

user table 2010-07-06
15:43:05.310



Column_name

Type

Computed Length
Prec Scale Nullable
TrimTrailingBlanks FixedLenNullInSource
Collation
--------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------
----------------------------------- ----------- ----- -----
-----------------------------------
-----------------------------------
-----------------------------------
--------------------------------------------------------------------------------------------------------------------------------
Total

int

no 4
10 0 yes (n/a)
(n/a)
NULL

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is row_number()?

584


How do you run a trace?

522


What is difference between primary key and foreign key?

482


What is sqlservr.exe - process - sql server (sqlex?press)?

604


How to create a view with data from multiple tables?

559






Can you type more than one query in the query editor screen at the same time?

576


Can we do dml on views?

555


What is awe?

572


What are the dmvs? : sql server database administration

600


What is user-defined function? Explain its types i.e. Scalar and inline table value user-defined function?

476


How to find Duplicate Records In table?

587


What is trigger and different types of Triggers?

578


What is dbcc?

737


How do you create a clustered index?

532


Why are views required in the sql server or in any other database?

540