Top "Alter-table" questions

The "ALTER TABLE" is a SQL statement that allows you to make schema changes to a database table (i.e. add, drop or alter columns from an existing table).

Changing Oracle table name

I'm trying to change a table name in oracle. I first run this script to declare the table CREATE TABLE …

sql oracle11g alter-table table-rename
How do I drop 'NOT NULL' from a column in MySQL?

A show create table command shows the following: 'columnA' varchar(6) NOT NULL DEFAULT ''; How do I modify that column …

mysql alter-table
Renaming multiple columns in one statement with PostgreSQL

Is it possible to rename multiple columns in a single statement, something along the lines of: ALTER TABLE Users RENAME …

sql postgresql ddl alter-table table-rename
Add primary key to PostgreSQL table only if it does not exist

I have simple table creating script in Postgres 9.1. I need it to create the table with 2-attributes PK only if …

sql postgresql primary-key alter-table postgresql-9.1
Problem adding Foreign Key using Alter Table with existing MYSQL Database - can't add it! Help!

I have a production database where I have renamed several column's that are foreign keys. Obviously mysql makes this a …

mysql foreign-keys alter-table mysql-error-1005 mysql-error-1025
MySQL: How to add a column if it doesn't already exist?

I want to add a column to a table, but I don't want it to fail if it has already …

mysql alter-table
How to add a (primary) key to an existing table using SAP HANA

What is the SQL command to add a (primary) key to a table in SAP HANA? The ALTER TABLE docu …

key primary-key hana alter-table
query " ALTER TABLE test_posts ADD sticky boolean NOT NULL default = false" = error

Whats wrong with my query? ALTER TABLE test_posts ADD sticky boolean NOT NULL default = false #1064 - You have an …

sql mysql alter-table
SQL Server -- Any way to add a column and make it first column in table?

I'm altering an existing table to add an Identity column. That I can do, no problem. But I'm wanting to …

sql sql-server alter-table identity-column
T-SQL Add Column In Specific Order

Im a bit new to T-SQL, Coming from a MySQL background Im still adapting to the different nuances in the …

sql-server tsql alter-table