I have a table whose primary key is used in several other tables and has several foreign keys to other tables. CREATE TABLE location ( locationID INT NOT NULL...
In Oracle SQL Developer, if I’m viewing the information on a table, I can view the constraints, which let me see the foreign keys (and thus which tables are...
Trying to create this example table structure in Postgres 9.1: CREATE TABLE foo ( name VARCHAR(256) PRIMARY KEY ); CREATE TABLE bar ( pkey SERIAL PRIMARY KEY, foo_fk VARCHAR(256)...
I’m designing my database schema using MySQL Workbench, which is pretty cool because you can do diagrams and it converts them 😛 Anyways, I’ve decided to use InnoDB because...
I’m having a bit of a strange problem. I’m trying to add a foreign key to one table that references another, but it is failing for some reason. With...
I’m trying to create foreign keys in Laravel however when I migrate my table using artisan i am thrown the following error: [Illuminate\Database\QueryException] SQLSTATE[HY000]: General error: 1215 Cannot add...
Why does add a foreign key to the tblDomare table result in this error? The ALTER TABLE statement conflicted with the FOREIGN KEY constraint “FK__tblDomare__PersN__5F7E2DAC”. The conflict occurred in...
I have tables that I’ve tried setting PK FK relationships on but I want to verify this. How can I show the PK/FK restraints? I saw this manual page,...
I remember hearing Joel Spolsky mention in podcast 014 that he’d barely ever used a foreign key (if I remember correctly). However, to me they seem pretty vital to...
I am getting the following error. Could you please help me? Msg 547, Level 16, State 0, Line 1 The INSERT statement conflicted with the FOREIGN KEY constraint “FK_Sup_Item_Sup_Item_Cat”....