SQL Server and Oracle Modify table structures are commonly used
SQL Server:
1. Add columns
ALTER TABLE users ADD address varchar (30);
2. Delete Columns
ALTER TABLE users DROP COLUMN address;
3. Modify the field type
Alter TABLE users ALTER COLUMN address varchar (80);
4. Rename the column:
EXEC sp_rename ' Wn_call_info. [Cust_code] ', ' cust_id ', ' COLUMN ';
5. Rename the table:
EXEC sp_rename ' customers ', ' custs ';
ORACLE:
1. Add columns
ALTER TABLE Sms_log ADD send_id number;
2. Delete Columns
ALTER TABLE users DROP COLUMN address;
3. Modify the field type
ALTER TABLE GROUP modify Creator_no varchar2 (50);
There is no replace table feature in SQL SERVER.
When creating a new table, you can tell if a table with that name already exists, and if it is, delete it after you create the
The following methods can be used to determine if a table exists: if OBJECT_ID (n ' usertablename ', n ' U ') is not NULL
DROP TABLE Usertablename
SQL Server and Oracle Modify table structure