Solved

Combine Multiple Alter Statements

Posted on 2011-02-10
1
307 Views
Last Modified: 2012-05-11
How can I combine these multiple statements into 1 alter statement:
ALTER TABLE address DROP INDEX 'zip';
ALTER TABLE address DROP INDEX 'phone';
ALTER TABLE address ADD 'fax' int(10) NOT NULL DEFAULT '0';
ALTER TABLE address ADD 'pobox' int(10) NOT NULL DEFAULT '0';
ALTER TABLE address ADD INDEX 'AddressIndex' ('UserID');

Thanks!
0
Comment
Question by:interclubs
1 Comment
 
LVL 40

Accepted Solution

by:
Sharath earned 500 total points
Comment Utility
You can club all into one statement.
alter table address drop index zip,
                    drop index phone,
                    add fax int(10) not null default 0,
                    add pobox int(10) not null default 0,
                    add index AddressIndex(UserID);

Open in new window

0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction In this installment of my SQL tidbits, I will be looking at parsing Extensible Markup Language (XML) directly passed as string parameters to MySQL 5.1.5 or higher. These would be instances where LOAD_FILE (http://dev.mysql.com/doc/refm…
All XML, All the Time; More Fun MySQL Tidbits – Dynamically Generate XML via Stored Procedure in MySQL Extensible Markup Language (XML) and database systems, a marriage we are seeing more and more of.  So the topics of parsing and manipulating XM…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now