java.math.bigdecimal
numeric
numeric
numeric
numeric
other
java.lang.object
other
other
other
NBSP;OTHERNBSP;
real
java.lang.float
real
real
real
real
smallint
java.lang.integer
smallint
smallint
smallint
smallint
time
java.sql.time
time
First, the data type:Integer: Int,bigint,smallintFractional: float,real,decimal (length, precision), numeric (length, precision)Characters: char (n), varchar (n) 8000 English characters, 4000 kanjitext--large text.Logic: Bit 0,1/true/falseBinary type: binary 8000,imageDate: DateTime (1753-1-1~9999,12,31), smalldatetime (1900.1.1--2079.6.6)The role of data types:
sql-server Common data typesAuthor statement:The first time to write a blog, there are some deficiencies, and then I first involved in software development this industry, is a small white, the article will certainly appear some wrong place, hope to find the wrong friends can timely point out, insufficient places also please all the way the great God to teach, so I reference and study, thank you.integer
From: http://blog.163.com/liufupanhao@126/blog/static/128465170201111210446407/
Thank you for sharing your ideas!
1. Data type conversion: (1) Two conversion scenarios:A: When the data between two result sets is compared or joined together, if the data types of the two result sets are different, they must be converted
bytes.Category five: String dataChar: Length is set, with a minimum of 1 bytes and a maximum of 8,000 bytes. The insufficient length will be blank.VARCHAR: The length is also set, the shortest is 1 bytes, the longest is 8,000 bytes, the trailing blanks will be removed.Text: Long-width is also set, the longest can be stored 2G of data.Category six: Unincode string dataNCHAR: The length is set, the shortest is 1 bytes, and the maximum is 4,000 bytes. The length of the gap is blank. Storing one ch
-- SQL: obtain all the field types and precision scripts of the specified data table, and directly execute the following script.Select a. Name,Case A. PrecisionWhen 0 then
Case A. is_ansi_paddedWhen 1 thenConvert (nvarchar (15), B. Name + '(' + convert (nvarchar (10), a. max_length) + ')')When 0 thenB. NameEndElse
Case A. ScaleWhen 0 thenB. NameElseB. Name + '(
, with a minimum of 1 bytes and a maximum of 8,000 bytes. The insufficient length will be blank.VARCHAR: The length is also set, the shortest is 1 bytes, the longest is 8,000 bytes, the trailing blanks will be removed.Text: Long-width is also set, the longest can be stored 2G of data.Category six: Unincode string dataNCHAR: The length is set, the shortest is 1 bytes, and the maximum is 4,000 bytes. The length of the gap is blank. Storing one character requires 2 bytes.Nvarchar: The length is set
Label:In the query process and query results for SELECT, each column, variable, expression, and parameter has a related data type. The data type is used to specify the type of data that an object can hold. The data types of SQL Se
(9223372036854775807.INT: 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 equiv
Select A.name as table name, b.name as column name, c.name as type, b.max_length as Byte count, b.precision As Integer, B.scale as decimal from Sys.tables a INNER JOIN Sys.columns B on a.object_id=b.object_id inner join Sys. Types C on c.user_type_id=b.user_type_idThis article is from the "IT" blog, so be sure to keep this source http://8577754.blog.51cto.com/8567754/1553205How to use a statement in an SQL
storage space. second, floating-point data typesfloating-point data types are used to store decimal decimals. The data for floating-point numbers is stored in SQL Server in a way that is rounded up (Round up or called only in). The so-called rounding means that when (and on
Label:[HierarchyID] is a good data type, provides a very convenient and high-performance tree-type query, the Internet to find a lot of information is not how to do dynamic insertion of this key point, from the MSDN carefully read the following information to write a demo CREATE TABLE employeeorg (orgnode hierarchyid PRIMARY KEY CLUSTERED, orglevel as Orgnode.getlevel (), EmployeeID
int UNIQUE NOT NULL, EmpName varchar (a) NOT NULL, Title varchar (+)
Tags: SQL statement sql SQLite
Image
Binary data types
The Image data type is used to store variable-length binary data up to 231-1 or approximately 2 billion bytes
Binary
Binary
Errors in converting data types in SQL commandsreproduced Problem Statement:PerformSELECT * from xxx_original_20031205where msgid=62010388000012statement, SQL Server reported an error: "An error occurred while converting data type varchar to numeric. "What does that mean?"M
The data types in SQL Server 2005 are grouped into the following categories:
Exact number
bigint
Decimal
Int
Numeric
smallint
Money
tinyint
SmallMoney
Bit
Approximate numbers
Float
Real
Date and time
Datetime
smalldatetim
[]
varchar
VARCHAR
String
tinyint
TINYINT
Short
uniqueidentifier
CHAR
String
Xml
LongVarCharSQLXML (Java SE 6.0)
StringSQLXML
Time
Time (1)
Java.sql.Time (1)
Date
DATE
Java.sql.Date
DateTime2
TIMESTAMP
Java.sql.Timestamp
DateTimeOffset (2)
Microsoft.sql.Types.DATETIMEOFFSET
Microsoft.sql.DateTimeOff
Objective
In the previous articles we explained the index of knowledge, this section we continue to explain the following content, short content, in-depth understanding.
Data type
SQL Server supports two types of character data, one is general and the other is Unicode. General d
The SQL92 standard defines several basic data types, which are the basis for various data types in the SQL database. In the article "string data type", we have discussed in detail the string d
: Rounding to the nearest value, rounding up, downloading, and rounding to zero. Microsoft SQL Server uses top rounding. All values must be accurate to the specified precision, but small floating point values may change. Because the binary representation of floating point numbers can use any of the many valid rounding rules, it is impossible for us to reliably quantify a floating point value.Convert decimal and numeric
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.