Hi,
I must be doing something foolish, but I can’t figure out where I’m going wrong. Ordinarily, I rely on Database Diagram to visually map the FK relationships between tables. But recently I was experimenting with SQL Server’s treatment of cascading FKs with a simple example, and Toad didn’t draw any arrows at all.
Here is the code. When I try to drag table1 to Database Diagram, it automatically pulls in table2 but does not draw the FK arrow between table2.lastModifiedBy and table1.user_ID:
CREATE TABLE table1
(
user_ID INTEGER NOT NULL PRIMARY KEY,
user_name **CHAR** (**50**) NOT NULL
)
GO
CREATE TABLE table2
(
author_ID **INTEGER** NOT NULL PRIMARY **KEY**,
author_name **CHAR** (**50**) NOT NULL,
lastModifiedBy **INTEGER** NOT NULL,
addedby **INTEGER** NOT NULL
)
GO
ALTER TABLE table2 ADD CONSTRAINT fk_one FOREIGN KEY (lastModifiedBy)
REFERENCES table1 (user_ID) ON DELETE CASCADE ON UPDATE CASCADE
GO
�
�