View Full Version : relationships in SQL


gemma-the-husky
04-01-2011, 04:51 AM
can you establish RI in a SQL backend - or is RI enforced in the front end

SQL_Hell
04-01-2011, 05:58 AM
I do not understand this question, SQL server IS a backend product there is no front end??

or are you not asking a SQL server question?

Banana
04-01-2011, 06:02 AM
As SQL_Hell alluded, SQL Server is your backend now. In Access, you had two files, one front-end and one back-end. You enforced RI in Access back-end.

You replace the Access back-end with SQL Server... but RI still stays in the SQL Server. Access front-end (or indeed, ANY front-end clients) cannot ever enforce RI for any database.

gemma-the-husky
04-01-2011, 06:23 AM
I couldn't see any obvious tools in SQL (MySql) to mange RI. I was using HeidiSQL - but I will also try the MySQL Workbench.

I will search again, as there is obviously something there.

dportas
04-03-2011, 01:48 AM
I couldn't see any obvious tools in SQL (MySql) to mange RI. I was using HeidiSQL - but I will also try the MySQL Workbench.

I will search again, as there is obviously something there.


ALTER TABLE ... ADD CONSTRAINT ... FOREIGN KEY is the tool for enforcing RI. You need to use the InnoDB engine to get foreign key support.

http://dev.mysql.com/doc/refman/5.5/en/alter-table.html