Use the ALTER TABLE statement in SQL to modify the table name. The steps are as follows: 1) Confirm permissions; 2) Write the statement (ALTER TABLE
RENAME TO ); 3 ) executes the statement. Note: The original table must exist, and the new table cannot already exist. Modification may affect dependencies. When the table name contains special characters, a reference identifier must be added.
SQL modify table name command
In SQL, you can use the ALTER TABLE
statement to modify the table name. The syntax is as follows:
<code class="sql">ALTER TABLE <原表名> RENAME TO <新表名>;</code>
Use steps
ALTER TABLE
statements according to the above syntax. Notes
Example
To change the table name old_table
to new_table
, you can use the following statement:
<code class="sql">ALTER TABLE old_table RENAME TO new_table;</code>
The above is the detailed content of Command to modify table name in sql. For more information, please follow other related articles on the PHP Chinese website!