473,657 Members | 2,351 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"Duplicate column name" error when adding column

I have two identical databases running on two separate servers. I want
to add a column to the following table:

classified_cats { acid , name , parent }

Running
ALTER TABLE `classified_cat s` ADD `is_active` TINYINT( 1 ) DEFAULT '0'
NOT NULL ;
on server A works fine, so I know the SQL is correct. Running the same
query on server B results in the following error:
Duplicate column name 'acid'.

The show create table SQL for server A is as follows:
CREATE TABLE `classified_cat s` ( `acid` int(11) NOT NULL
auto_increment, `name` varchar(255) NOT NULL default '', `parent`
int(11) NOT NULL default '0', PRIMARY KEY (`acid`) ) ENGINE=MyISAM
DEFAULT CHARSET=latin1

The show create table SQL for server B is as follows:
CREATE TABLE `classified_cat s` ( `acid` int(11) NOT NULL
auto_increment, `name` varchar(255) NOT NULL default '', `parent`
int(11) NOT NULL default '0', PRIMARY KEY (`acid`,`acid`) )
ENGINE=MyISAM DEFAULT CHARSET=latin1

Note the difference in PRIMARY KEY - I'm not sure what (`acid`,`acid`)
means.

Any ideas on how to overcome this?

TIA

Andy

Jan 12 '06 #1
1 9982
Found a solution:
1) Dump the table.
2) Recreate with the SQL corrected to ...PRIMARY KEY(`acid`)
3) Source the dump.

Then the ALTER TABLE statement works as expected.

Think it was a problem due to server B being upgraded to MySQL 5.0.

Andy

Jan 12 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1645
by: susanwinchell | last post by:
I have a table with only two columns (created from query of a much larger database). The first column contains many "duplicate" names or ID, and the second column contains values which need to be summarized by by each name or ID. How can I do this automatically? Here's the example of what I have now:
3
4481
by: Steve N. | last post by:
I was adding some new files to a project and changed a few options, now when I compile I get "'MessageBoxA' : is not a class or namespace name" on this line (and many others like it): System::Windows::Forms::MessageBox::Show(this, Error, caption, buttons, MessageBoxIcon::Exclamation, MessageBoxDefaultButton::Button1); Well, it worked before, and I cannot seem to undo whatever I did to cause it. I didn't touch any of the 'using namespace'...
2
3381
by: Antanas | last post by:
I applied FP9a on top DB2 UDB 8 FP8. Now I notice in Control Center to get this error: CLI0611E Invalid column name. SQLSTATE=S0022 when I slelect any table then Show Related->Tables Spaces. Is supposed to be happening?
2
1875
by: athos | last post by:
Dear All, Our project was done in SQL 2000, now we are migrating to 2005. however, there are lots of command such as: a) SELECT * FROM myTableName which, shall be b) SELECT * FROM myLoginId.myTableName
0
1158
by: postings | last post by:
Hi Microsoft need to reopen this bug... http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=f4c529ae-4879-41a0-9f24-984923f20999 Visual Studio 2005 Pro (final) has this bug. Suggested workaround works (adding an entry in the hosts file) but this is an annoyance and Microsoft needs to confirm it is developing a fix for this. It appears they keep closing the bug (twice now) when they see the workaround.
6
14376
by: crs27 | last post by:
Hai, Im getting this error.There is a column by name "nr_first_name" in the table "gistl_new_request". Yet im getting as that dose not exist.Would like to now what is the cause of it. Thank You
0
1561
by: UT-BadBoy | last post by:
Hi, I've been working with ASP.NET for about a year so I'm still considering myself to be somewhat of a novice in this field. I am receiving this particualr error when trying to hit a webservice from an IE browser: The namespace, , is a duplicate. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more
5
1649
by: Chris Botha | last post by:
There is a database table with one of the columns named "System". When creating a new Dataset for this table, the project gives a huge number of compile errors. If I change the column name to be anything else than "System" and re-generate the Dataset, it works. The problem is that this is an existing database and there is no way that the column name will be changed.
1
8649
by: JaganMohanRao | last post by:
i have create a table and inserted a values init. when i am getting the values it is throwing the exception "ERROR: column "dtype" of relation "xxxx" does not exist" where xxxx is table name. if any body knows the solution kindly help me Thanks in advance .. Jagan
0
8312
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8504
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8606
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4159
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4318
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2732
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1959
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1622
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.