Top "Alter" questions

'alter' is a SQL keyword used to change or modify the table structure or the records in a table.

How to alter a MySQL table's foreign key using the command line

How to alter an existing table in MySQL, setting foreign key to another table, using the command line?

mysql alter-table alter
What is the equivalent of 'CREATE TABLE ... LIKE ..." in SQL Server

I am working with SQL Server (I am a SQL Server noob) and trying to alter a table. I want …

sql-server tsql alter
How to modify datatype of a column with a default value

I'm trying to change the datatype of a column in SQL Server from tinyint to smallint. But there's a default …

sql sql-server default-value alter
Optimize mySql for faster alter table add column

I have a table that has 170,002,225 rows with about 35 columns and two indexes. I want to add a column. The …

mysql performance alter
Adding new enum column to an existing table

I'm trying to add a gender column to my table with this query: ALTER TABLE QRCodeUser ADD gender CHAR(1) enum(…

mysql enums alter
How to change the primary key to be non-clustered?

Part-time reluctant DBA here. I want to change an existing primary key index from clustered to non-clustered. And the syntax …

sql sql-server-2005 clustered-index alter
alter composite primary key in cassandra CQL 3.0

I'm in a situation where I need to change the the composite primary key as follows: Old Primary Key: (id, …

cassandra composite-primary-key alter cql3 cqlsh
How can I alter multiple tables at once in mysql?

I am trying to alter multiple tables and change the size of the username VARCHAR column to 999 as its current …

mysql alter
MySQL - How to modify column default value?

How do I change my column's default value from None to something else? For example, I want my dates to …

mysql sql default alter
How to alter user defined table types

I have already tried to alter the user defined table types but it is not working with alter commend. alter …

sql-server alter user-defined-types