1. Add a new column to the existing table in the database Statement:altertable name add column name type Example:alter MyUser ADD Userdesc VARCHAR(+);2. Name the rename in the existing tables in the database Statement:altertablecolumn to new columns
17:39:37 |
+---------------------+---------------------+
3 Rows in Set (0.00 sec)
At this point we can delete the original mytime table
mysql> drop table mytime;
Query OK, 0 rows Affected (0.00 sec)
We can also use a special SQL statement to implement. That is the Rename command, as follows:
Mysql>
Rename the column name and table name in oracle directly in pl/SQL and then in oem, however, you may not be able to change the lower-case table name to the upper-case
Five ways to change MySQL database name:
The code is as follows
Copy Code
1. RENAME DATABASE db_name to New_db_name
This one.. This syntax is added to the MySQL 5.1.7, 5.1.23 and removed.It is said that it is possible to lose data. It's better not to use it.
It's simple, just a rename. Grammar:
The code is as f
SQL modifies the database name, table name, and field name
[Materials from the network]
Modify database name: alter database original database name modify
databaseSysindexs each database indexSysmenbers each database role memberSysobjects all database objects in each databaseSyspermissions permissions for each databaseSystypes user-defined data types for each databaseSysusers each database user
//How can I obtain all the column names in a table. SQL statement.Select column name =
Tags: set l database collect text code span ret CTI Lin usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text; namespace_03 Major Item { Public classDeskinfo {//Deskid, Deskname, Desknamepinyin, Deskdelflag, Desknum
Private int_deskid; ///
///the ID of the dining table///
Public intDeskid {Get{return_deskid;} Set{_deskid =value;} }
Private string_deskname; ///
///the
added:Debug on the company's network today. connect to an SQL Server 2000. an error occurred while loading the table name. later I compared SQL Server 2005 on my computer. no sys. schemas (view ). (It seems that the concept of schema does not exist. sorry, I am still a little white on the database .) after several att
I am working on secondary development of an application. All databases are locked. The table name of the user table is user.
Now I want to use nhib.pdf for persistent connection to the SQL database. The result is a syntax error (SQL database syntax error) caused by the
The Code is as follows:
EXEC sp_rename 'table name. [original column name] ', 'new column name', 'column'
Transact-SQL referenceSp_renameChange the name of the user-created object (such as a
How does db2 rename a table ?, How does db2 rename a table?How does db2 rename a table?
Set The current schema: db2 => set schema db2adminDB20000I The SQL command completed successfull
Label:Dynamic Statement Basic syntax:1: Normal SQL statements can be executed with execSELECT * from TableName exec (' select * from TableName ')EXEC sp_executesql n ' select * from TableName '--please note that the string must be added n before2: Field name, table name, database n
If you want to change the name of the table column as required, you usually choose server-database-table from isisemanager and modify the table. This is too troublesome. You can use the script to check it.
To change the name of the table
The Code is as follows:EXEC sp_rename 'table name. [original column name] ', 'new column name', 'column'Transact-SQL referenceSp_renameChange the name of the user-created object (such as a tab
Modify the table name and field name in an SQL statement.
Today, we have a temporary task to modify the database table name and field name in the production environment. In the past, t
Method One: Use SQL statement to modify MySQL database table prefix name
The first thing we think of is to use SQL query statements to modify, this method is also very convenient, just enter the phpMyAdmin, in the Run SQL query box to enter the following
Reprint: http://www.accessoft.com/article-show.asp?id=6135Often encountered some forget the table name situation, at this time only remember a approximate, at this time can be queried by the system table sysobjects to find the table name, such as to find the
CodeAs follows:Exec sp_rename 'table name. [original column name] ', 'new column name', 'column'
**************************************** *********************************Transact-SQL reference
Sp_renameChange the name of the us
Code example for extracting information such as database table name and field name using SQL
This article describes how to use SQL statements to extract the instance code of table names and field names of all tables in the databas
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.