Data type SQL Server
By FoxLearn 2/19/2024 9:41:15 AM 226
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 convert varchar to uniqueidentifier in SQL Server
- JDBC sqlserver connection string
- Connection string odbc
- How to convert datetime to date (with time set to 00:00:00.000) in SQL
- How to set time to 00:00:00 with GETDATE() in SQL
- How to convert varchar to integer in MySQL
- How to fix 'string or binary data would be truncated' in sql
- How to Restore SQL Database Backup in C#