SQL Server Data Types
SQL Server Data Types
K & Bharat
DATA TYPES
Char – Fixed data type. So it takes up whatever size is assigned, even if not used.
Varchar – Variable data type. Takes up space of the #character entered and not
the size assigned.
Bit type – datatype which express Boolean value. Used to store Boolean
information. Before 7.0 it stores only two states (0 and 1) from 7.0 on it has 3 states
(0, 1 , NULL)
Int – (4), BigInt – (8) From SQL2000 only, Small Int – (2), TinyInt – (1)
Lets you extend the base SQL server data types by providing a descriptive name
and format to the database. Eg. Flight_# appears in many tables and all these
tables have varchar(8) Create a user defined data-type.
table variables are cleaned up automatically at the end of the function, stored procedure,
or batch in which they are defined.
• table variables used in stored procedures result in fewer recompilations of the stored
procedures than when temporary tables are used.
• Transactions involving table variables last only for the duration of an update on the table
variable. Thus, table variables require less locking and logging resources.
Jan 2007