1. Data type width
Display width
The integer data type in MYSQL can specify the display width, but SQLSERVER cannot
Create a table
The data type of the id field is BIGINT(1). Note the number 1 at the end, which indicates that the data type is specified. The display width specifies the number of digits in the value that can be displayed.
For example, suppose you declare a field of type INT YEAR INT(4)
This declaration indicates that the data in the year field generally only displays a width of 4 digits.
An error will be reported in SQLSERVER
If a value larger than the display width is inserted, as long as the value does not exceed the integer of this type Within the value range, values can still be inserted and displayed.
For example, insert a value 19999 into the year field. When using select query, MYSQL will display the complete 19999 with 5 digits instead of the 4-digit value
If the display width is not specified, MYSQL specifies a default width value for each type
tips: The display width is only used for display and cannot limit the value range and occupied space. For example: INT(3) will It occupies 4 bytes of storage space, and the maximum value allowed is not 999, but the maximum value allowed by the INT integer type
.
SQLSERVER