[Sybase] Foreigh Key/Index column

来源:互联网 发布:unity3d性能分析器 编辑:程序博客网 时间:2024/06/02 05:23
alter table SSQLquery drop constraint SSQLquery_1925867665 (queryName) REFERENCES SSQLqueryEx(queryName)
alter table SSQLquery drop foreign key SSQLquery_1925867665 (queryName) REFERENCES SSQLqueryEx(queryName)

alter table SSQLquery add foreign key (queryName) REFERENCES SSQLqueryEx(queryName)





If  there are updates to the index field(posId) of table "trade" in the sql script, actually it does not comply with current sql standard:

Prerequisites to update index field of a table:

1. The table has no constraint on the index.
2. Index field is unique.

For table "trade", the table has no constraint, but the its index field is not unique, so we can not update the index field(posId), btw, there is no error message for such operation.