检查列/键是否存在? [英] Check Column/Key Exists?

查看:97
本文介绍了检查列/键是否存在?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行x-cart 4.23并升级到4.4,因此我需要升级数据库.

I am running x-cart 4.23 and upgrading to 4.4 so I need to upgrade the database.

这是错误.

SQL error #1091 : Can't DROP 'PRIMARY'; check that column/key exists SQL query: ALTER TABLE xcart_customers DROP PRIMARY KEY

最初的错误是这个....

The original error was this....

SQL error #1075 : Incorrect table definition; there can be only one auto column and it must be defined as a key

SQL query: ALTER TABLE xcart_customers DROP PRIMARY KEY

当我清除了内容后,不知道从哪里开始.

When I cleared that I ran into that and have no idea where to start.

推荐答案

此错误表示您正在尝试删除另一个表正在使用的键.

This error means that you are trying to delete a key which is being used by another table.

例如考虑tblMovies和tblActor,电影包含一个或多个演员,并且您不能删除删除tblActors条目(或删除PK),直到您删除具有这些演员的电影.

e.g. consider tblMovies and tblActors, movies contain one or more actors and you can't delete delete the tblActors entries (or drop PK) until you delete the Movies featuring those actors.

然后将不会链接演员,因此您可以将其删除.

Then the actors won't be linked so you can delete them.

这篇关于检查列/键是否存在?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆