Data types for 1.SQL server
Data class is a property of data that represents the type of information that the data represents. Any computer language defines its own
Tags: SQL Server 2014 log shipping13.2.4 Deploying log shipping with Management StudioUse SQL Server Management Studio to deploy the log shipping steps as follows:(1) Open the Properties page for the primary database DB01 as log shipping in the primary
smalldatetime
The date from January 1, 1900 to June 6, 2079 (each value requires 4 bytes of storage space).
Datetime
January 1, 01 00:00:00.0000000 to December 31, 9999 23:59:59.9999999
1900-01-01 0:00:00
Datetime
smallint
Integer data from -2^15 (-32,768) to 2^15-1 (32,767). The storage size is 2 bytes.
Int16
-32768 to 32767
Int16.minvalue
Int16
SmallMoney
each character, rather than a single byte (in normal text). It allows for a large number of extended characters. This data type can store 4000 characters, which is used to increase the byte space by one times.Nvarchar Unified coded character typeThe nvarchar data type is used as a uniformly encoded character type data that is variable length. This
Environment: SQL Server 2008 R2
An exact numeric data type that uses integer data.
bigint
Integer data (all numbers) from -2^63 (-9223372036854775808) to 2^63-1 (9223372036854775807). The storage size is 8 bytes.
Int
Integer data
) is equivalent to the fact that text and Ntext,varchar (max) can store up to 2G of data (later versions may be more), but text and ntext do not support "=", "Left ()" , like, and varchar (max) and nvarchar (max) support, and Microsoft may remove the text and ntext types in SQL Server later, you should use varchar (max
SQL Server changes blob-related data types starting with 2005, such as text and ntext to varchar (max) and nvarchar (max), and image to varbinary (max). 2008 continues to add some new time-and date-related data types, as well as s
).
Tinyint: Integer 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
Java Data types
Hibernate data type
Standard SQL data types(PS: May vary for different db)
BYTE, Java.lang.Byte
Byte
TINYINT
Short, Java.lang.Short
Short
SMA
Although int is still the primary integer data type in SQL Server 2000, SQL Server 2000 is a new addition to the integer data type bigint, which applies to situations where integers exceed the int
Label:A data table is made up of multiple columns, and you must specify the data type of each column when you create the table. The following is a list of usage rules for common SQL Server data types .
Integer ty
Tags: fixed har char trim definition length take number requires VarThe length of the char type is immutable in SQL Server, and the length of the varchar is variable.When depositing data:If the data type is char, when a fixed length of a field is defined, if the length of the stored data is less than the length of char
Search the internet about the data types of comparison, there are almost no three database comparison, I wrote some of the comparison of the fields, if there is a wrong place, please feel free.
Java fields
Oracle Fields
MySQL Field
SQL Server Fields
Int
Number
Int
of digits that can be stored (left and right of the decimal point). P must be a value between 1 and 38. The default is 18. The s parameter indicates the maximum number of digits stored to the right of the decimal point. s must be a value between 0 and P. The default is 0. 5-17 bytessmallmoney The currency data between -214,748.3648 and 214,748.3647. 4 bytesMoney data between -922,337,203,685,477.5808 and 9
indicator must also be specified.When you create a memory-optimized table, there are only a few other restrictions except for the columns of the data types that are listed:· no DML triggers;· No foreign key or check constraint;· No identity column;· There is no unique index except the primary key;· Up to 8 indexes, including indexes that support primary keys.Also, once a table has been created, the schema
In our daily development process, when designing a database, we often encounter problems with selecting data types, choosing what type of data is most appropriate, and then choosing the corresponding CLR type when we create the corresponding entity in the project. In response to these questions, this article was born.
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.