Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

Browse by Tags · View All
sql_server 217
t-sql 211
tsql 116
sqlserver 96
BRH 78
#SQLServer 66
#TSQL 56
SQL Server 34
function 11
SSMS 9

Archive · View All
August 2007 17
August 2010 8
June 2012 7
June 2011 7
November 2007 7
August 2012 6
May 2012 6
November 2011 6
August 2011 6
October 2011 6

Madhivanan's TSQL Blog

COUNT_BIG function - counting very big resultsets

Oct 26 2010 5:58AM by Madhivanan   

If you want to count the number that exceeds the maximum value of INT datatype, you can make use of COUNT_BIG function. COUNT_BIG function always returns a bingint datatype value. Consider the following example code which uses both COUNT_BIG and COUNT function

select COUNT_BIG(*) as big_number, COUNT(*) as number into #t

select * from #t

Now execute this code to see the datatypes of these columns

select 
	c.name as column_name, t.name as data_type 
from 
	tempdb..syscolumns as c inner join tempdb..systypes as t
on c.xtype=t.xtype 
where 
	id=OBJECT_ID('tempdb..#t')
	

The result is


column_name           data_type
-----------------     ----------
number                int
big_number            bigint

Note that the big_number column has a datatype of bigint and if you have want to count rows with more than 2147483647 rows you can use that function

Tags: t-sql, sql_server, sqlserver, tsql, BRH, #TSQL, #SQLServer, count, count_big,


Madhivanan
3 · 39% · 12472
0
Liked
 
0
Lifesaver
 
0
Refreshed
 
0
Learned
 
0
Incorrect



Submit

Your Comment


Sign Up or Login to post a comment.

    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]