There are two types of data types in SQL Server
c. Date Data Types:
- Simple data types
- User defined data types
1. Simple data types:
- The data types provided by software are called simple data types.
a. Character Data types:
- Char(n):
- It is a fixed length data type used to store the character data.
- Default size is 1 byte
- Memory wastage if not used
- Maxi size is allowed for n is 800 bytes.
2. Varchar(n):
- It is a character data type used to store the character data.
- It is variable length data type.
- Default size is n byte
- Maxi size is 800 bytes.
- Unnecessary memory is not allocated
- no memory wastage.
3. nchar(n):
- It is the fixed length charcter data type used to store the character data.
- Maximum size of 'n' is 400 bytes.
4. nvarchar(n):
- It is the variable length character data type used to store the character data.
- Maximum size - 400 bytes
b. Numeric Data Types:
Numeric data types |
Used to store date and time values.
- datetime:
- It is used to store date values from 1st January 1753 to 31-December-9999.
- Default size is 8 bytes.
2. smalldatetime:
- It is used to store date value from 1st January 1900 to 6th June 2079
- Default size is 4 bytes.
No comments:
Post a Comment