Count int1 values (implicitly non-null) : integer « Data Types « SQL Server / T-SQL Tutorial






4> CREATE TABLE T (
5>     int1 int,
6>     bit1 bit,
7>     varchar1 varchar(3),
8>     dec1 dec(5,2),
9>     cmp1 AS (int1 + bit1)
10> )
11> GO
1>
2> INSERT T (int1, bit1) VALUES (1, 0)
3> INSERT T (int1, varchar1) VALUES (2, 'abc')
4> INSERT T (int1, dec1) VALUES (3, 5.25)
5> INSERT T (bit1, dec1) VALUES (1, 9.75)
6> GO

(1 rows affected)

(1 rows affected)

(1 rows affected)

(1 rows affected)
1> SELECT COUNT(int1) 'int1 values in T'
2> FROM T
3> GO
int1 values in T
----------------
               3
Warning: Null value is eliminated by an aggregate or other SET operation.
1> drop table t;
2> GO
1>
2>
3>








5.13.integer
5.13.1.SQL Server integer datatypes.
5.13.2.A SELECT statement that retrieves rows with zero values
5.13.3.To use a numeric literal, enter the number without quotes.
5.13.4.Using AVG on INTEGER values.
5.13.5.Convert the return datatype from INTEGER to FLOAT by multiplying the data in the INTEGER column by 1.0 to convert to FLOAT.
5.13.6.int OUTPUT parameter
5.13.7.Conversion failed when converting the varchar value '97/522' to data type int.
5.13.8.Using convert to convert integer to characters
5.13.9.Count int1 values (implicitly non-null)