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).

'invalid for creating a default constraint' error when trying to add a constraint to an existing table

I want to add a default constraint using ALTER TABLE in SQL Server, but I received the below error message …

sql sql-server constraints alter-table
Can you index tables differently on Master and Slave (MySQL)

Is it possible to set up different indexing on a read only slave, from on the master? Basically, this seems …

mysql replication alter-table indexing
Rename column only if exists

PostgreSQL does not allow ALTER TABLE t RENAME COLUMN IF EXISTS c1 TO c2 ...or anything like that. However, it's …

postgresql ddl alter-table
Mysql change column details

I am trying to redefine the number of varchars a column can have (in a MySQL db). I am doing …

mysql alter-table
SQL Server: Create Nonclustered Index without giving a name to it

I use SQL Server 2008. I am trying to create a nonclustered index on my table. I want to check if …

sql-server indexing alter-table clustered-index non-clustered-index
Why am I getting "ORA-01429: Index-Organized Table" when trying to modify column from VARCHAR2(200) to VARCHAR2(1000)?

It's currently a VARCHAR2(200) in the database, but it needs to be raised to VARCHAR(1000), so I am attempting to …

oracle alter-table varchar2
Create column and insert into it within the same transaction?

Is it possible to create a column and insert values to it during the same transaction? This is part of …

sql-server tsql transactions alter-table
How to add a column in clickhouse

I have a table in clickhouse, say "my_table", which has replicates (my_table_rep1,...). And I need to add …

alter-table clickhouse
Add a column to a large MySql table while online

I need to add a new column to a table in MySQL DB (MyISAM table) that contains more than 20 Million …

mysql myisam alter-table large-data
if exists alter table statement with not null or default value doesn't work

I try to add one new column column2 into the test_tbl and set the column with default value 'N/…

sap-ase alter-table