In SQL Server, when we set character fields, there are often many data types for us to choose from, such as char nchar varchar nvarchar. Which one should we choose? The differences are described one by one.
Char:Fixed Length, non-Unicode character data, length is n Bytes. Th
Uncover new features of SQL Server 2014 (2)-SSD Buffer Pool (buffer Pool) expansion, 2014 Buffer
Introduction
Another good feature in SQL Server 2014 is that SSD can be virtualized into
Float and real
Approximate-number data types for use with floating point numeric data. Floating Point Data is approximate; therefore, not all values in the Data Type range can be represented exactly. The ISO synonymRealIsFloat (24).
SQL Server data typesTransact-SQL ———— database programming languageOne or two binary data binary data is stored in 16 binary form.Format: 1, binary (n) ———— a fixed-length n-byte binary data
Several types of data commonly used in SQL Server:
Binary
Fixed-length binary data with a maximum length of 8,000 bytes.
varbinary
Variable-length binary data with a maximum length of 8,000 bytes.
Image
Variable-length binar
: integer data from-2 ^ 31 (-2,147,483,648) to 2 ^ 31-1 (2,147,483,647.Smallint: integer data from-2 ^ 15 (-32,768) to 2 ^ 15-1 (32,767.Tinyint: integer data from 0 to 255.Bit: an integer of 1 or 0.(4) decimal and numericThe two data types are equivalent. There are two param
data from 0 to 255.
Bit:1 or 0 of integer data.
(4) Decimal and numeric
The two types of data are equivalent. have two parameters: P (Precision) and S (scale). p Specifies the maximum number of decimal digits that can be stored to the left and right of the decimal point, and P must be a value from 1 to 38. s specif
The date and time data from January 1, January 1-20, 1900 to January 1, June 6 are accurate to minutes.String
Char
A fixed length of non-Unicode characters. The maximum length is 8,000 characters.
Varchar
Variable-length non-Unicode data, which can contain a maximum of 8,000 characters.
Text
Variable-length non-Unicode data. The maximum length is 2 ^ 31-1 (2,147
Common Data Types in SQL Server:
BinaryA fixed-length binary data with a maximum length of 8,000 bytes.
VarbinaryA variable-length binary data with a maximum length of 8,000 bytes.
ImageA variable-length binary
Common Data Types in SQL server:BinaryA fixed-length binary data with a maximum length of 8,000 bytes.VarbinaryA variable-length binary data with a maximum length of 8,000 bytes.ImageA variable-length binary data with a maximum le
In industrial control applications, the returned data is often stored in binary format, and the binary data represents a hexadecimal data content every 4 bits. During parsing, a single Byte usually occupies eight digits (bit). 4 bits at the top indicate a hexadecimal data, and 4 bits at the bottom indicate a hexadecima
In industrial applications, the returned data is often stored in binary form, and these binary data represent a hexadecimal data content per 4 bit. Parsing, often a byte (byte) occupies 8 bits (bit), high 4bit represents a hexadecimal data, low 4bit represents a hexadecimal data
In industrial control applications, the returned data is often stored in binary format, and the binary data represents a hexadecimal data content every 4 bits. During parsing, a single Byte usually occupies eight digits (bit). 4 bits at the top indicate a hexadecimal data, and 4 bits at the bottom indicate a hexadecima
Environment: SQL Server 2008 R2
Question: SQL Server date, datetime, Smalldate difference
Solve:
Datetime
Date and time data from January 1, 1753 to December 31, 9999, with an accuracy of 3% seconds (equal to 3.33 milliseconds or 0.00333 seconds). Adjust the value to the
The following table lists the. NET Framework type, dbtype, sqldbtype enumeration, and sqldatareader accessors.
SQL Server database engine type
. NET Framework type
Sqldbtype Enumeration
Sqldatareader sqltypes type accesser
Dbtype Enumeration
Sqldatareader dbtype type accessors
Bigint
Int64
Bigint
Getsqlint64
Int64
Getint64
Binary
Byte []
Varbina
server| Data | data type///Comparison of data types in the database with C #
private string Changetocsharptype (String type)
{
String reval=string. Empty;
Switch (type. ToLower ())
{
Case "int":
Reval= "Int32";
Break
Case "Text":
Reval= "String";
Break
Case "bigint":
Reval=
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.