1

In the database scheme there are some cyclic references. It causes problems. References are created by provider using generated names:

alter table users add constraint FK_olm1qeb13uc1worutbx1sc22k foreign key (USER_ID) references user_settings
alter table user_settings add constraint FK_3ry0dxqxek7eg9frxr6bpofr9 foreign key (USER_ID) references users

I need a solution that is described here, but for MsSql Server. Is there a way in HSQLDB to remove all constraints of concrete type (foreign key (USER_ID) references) when I know only table name?

Without writing stored procedure.

Community
  • 1
  • 1
Alexandr
  • 9,213
  • 12
  • 62
  • 102

1 Answers1

0

Use a query on INFORMATION_SCHEMA to find the names of constraints used on a particular table:

SELECT * FROM INFORMATION_SCHEMA.CONSTRAINT_TABLE_USAGE WHERE TABLE_NAME = 'USERS'
fredt
  • 24,044
  • 3
  • 40
  • 61
  • I need a way to drop constraints via script. not just a simple query that returns constraint names.just like the answer like this: http://stackoverflow.com/questions/8641954/how-to-drop-column-with-constraint#answer-13715343 – Alexandr Feb 09 '15 at 13:01