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

Can I create a named default constraint in an add column statement in SQL Server?

In SQL Server, I have a new column on a table: ALTER TABLE t_tableName ADD newColumn NOT NULL This …

sql-server constraints alter-table code-maintainability
Create an index on a huge MySQL production table without table locking

I need to create an index on a ~5M rows MySQL table. It is a production table, and I fear …

mysql indexing production alter-table table-locking
SQLite Modify Column

I need to modify a column in a SQLite database but I have to do it programatically due to the …

sqlite alter-table
What does the Alter Table syntax look like for adding a DATETIME column?

I can't find what the syntax looks like for adding a DATETIME column to a mysql table when I want …

sql mysql alter-table default-constraint
MySQL very slow for alter table query

Why is it taking more than an hour to simply update this table to add a column? This table has 15…

mysql sql alter-table
Add column to table and then update it inside transaction

I am creating a script that will be run in a MS SQL server. This script will run multiple statements …

sql sql-server tsql transactions alter-table
sqlite alter table add MULTIPLE columns in a single statement

Is it possible to alter table add MULTIPLE columns in a single statement in sqlite? The following would not work. …

sql sqlite alter-table
check if column exists before ALTER TABLE -- mysql

Is there a way to check if a column exists in a mySQL DB prior to (or as) the ALTER …

mysql alter-table
Alter multiple columns in a single statement

I am using a query to alter the charset of a column ALTER TABLE `media_value_report` CHANGE `index_page_…

mysql sql mysql-error-1064 alter-table
Alter table if exists or create if doesn't

I need to run an installer which can also be an updater. The installer needs to be able to end …

mysql alter-table create-table