Obtain the table field name (SORT ):
SELECT. name as field name FROM syscolumns a inner join sysobjects d on. id = d. id and d. xtype = 'U' and d. name <> 'dtproperties' where d. name = 'table name' order by. id,. colorder
Expected table field name:
You see this article from HTTP://WWW.CNBLOGS.COM/AYANMWReprinted from: http://blog.csdn.net/daydreamingboy/article/details/6310907Analyze the length of the MySQL data typeMySQL has several data types that can limit the "length" of a type, with char (
The counting method of querying a field type from pl/SQL is number and the length is greater than 16 bits is displayed as scientific notation pl/SQL query field type from pl/SQL is number and the length is greater than 16 bits the content is
In mysql, we only need to use alter to modify the data table fields. Below I will introduce how to modify the table field name, field length, and field type in mysql, for more information, see.
Let's take a look at common methods.
The simple Syntax
Grammar:Alter Table table name >altercolumn field name > new type name (length)Example: If a named T1, the field name F1, the original F1 is varchar (3), now to varchar (10), then you can write:Alter Table Alter column varchar (ten)In general, you
Type of a value
Storage required for column typesTINYINT 1 bytesSMALLINT 2 bytesMediumint 3 bytesINT 4 bytesINTEGER 4 bytesBIGINT 8 bytesFLOAT (x) 4 if X FLOAT 4 bytesDOUBLE 8 bytesDOUBLE PRECISION 8 bytesReal 8 bytesDECIMAL (m,d) m bytes (d+2, if
In addition to some restrictions, seeMS-help: // Ms. sqlcc. V9/ms. sqlsvr. v9.zh-CHS/tsqlref9/html/f1745145-182d-4301-a334-18f799d361d1.htm about modifying column restrictions. When modifying columns that can be modified, pay attention to the
Citation: Http://www.2cto.com/database/201209/155178.htmlSQL statement gets all database names, table names, field names, table fields length gets all the tables in the database select Sysobjects.name as Tablename from sysobjects WHERE xtype = ' U '
Grammar:ALTER TABLE ALTER column new type name (length)Example: If a named T1, the field name F1, the original F1 is varchar (3), now to varchar (10), then you can write:ALTER TABLE T1 ALTER COLUMN F1 varchar (10)In general, you can use this
Oracle modifies the field type and length, and oracle modifies the field
Modify the field name in Oracle
Alter table name rename column old field name to new field name
Modify the field type and length in Oracle
Alter table name modify Field
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.