Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How to modify the field length of sql statement
How to modify the field length of sql statement
Code example:

alter table t 1 alter column f 1 varchar( 10)

In general, you can change the field name with the following statement:

Copy code code example:

Rename column a to c

In practical application, J-SQL is often used to compile, but J-SQL does not support modifying field names.

Therefore, if it is necessary to modify the field name, it can only be done by flexible methods.

Ideas:

1. Create a new field and name it c;

2. copy the contents of field a to c;

3. Delete field A;

Syntax of modifying field length by sql:

Change the table name and modify the field name field type;

Sql modify field length:

Copy code code example:

alter table qtline modify QTL _ bider note varchar 2(4000);

Standard SQL, applicable to any database.

Copy code code example:

alter table fzrtmis . report template modify REPNAME varchar( 100);

Modify the field name:

Copy code code example:

Change the form? TABLENAME renames the column COL 1 to COL2.

Add field:

Copy code code example:

Change table fzrtmis.itiembuildqk Add? STATIONSTATE? CHAR( 1)