Data type SQL Server
By FoxLearn 2/19/2024 9:41:15 AM 400
Here are some common data types used in SQL Server:
1. Numeric Data Types:
- INT: Integer data type for storing whole numbers.
- BIGINT: Large integer data type.
- DECIMAL/NUMERIC: Fixed-point decimal numbers.
- FLOAT/REAL: Floating-point numbers.
2. Character String Data Types:
- CHAR(n): Fixed-length character data type.
- VARCHAR(n): Variable-length character data type.
- TEXT: Variable-length character data for large text.
- NCHAR(n): Fixed-length Unicode character data.
- NVARCHAR(n): Variable-length Unicode character data.
- NTEXT: Variable-length Unicode character data for large text.
3. Date and Time Data Types:
- DATE: Date data type.
- TIME: Time data type.
- DATETIME: Date and time data type.
- DATETIME2: Date and time data type with higher precision.
- TIMESTAMP: Automatic timestamp value.
4. Binary Data Types:
- BINARY(n): Fixed-length binary data.
- VARBINARY(n): Variable-length binary data.
- IMAGE: Variable-length binary data for storing images or large binary objects.
5. Other Data Types:
- BIT: Boolean data type.
- UNIQUEIDENTIFIER: Globally unique identifier (GUID).
- XML: XML data type.
- JSON: JSON data type (available in newer versions).
These are just some of the data types available in SQL Server. Each data type serves a specific purpose and allows for efficient storage and manipulation of data within the database.
- How to Download and Restore Northwind database to SQL Server
- How to set time to 00:00:00 with GETDATE() in SQL
- Restoring MySQL Databases with mysqldump
- How to use Oracle linked server shows all tables
- Download backup of Northwind database for SQL Server
- How to Convert varchar to uniqueidentifier in SQL Server
- How to fix 'The transaction log for the database is full due to ACTIVE_TRANSACTION'
- How to use ROW_NUMBER Function in SQL Server