Hello all,
I have a question about Directed acyclic graphs. I am new to Microsoft SQL server coming from MySql. The reason why I am now using MS SQL is the need for nodle graphs in a relational database. I have been reading so much on this, I really need this to work. I have been trying this from and I cannot get anything to work. I am just trying to create a few tables:
The problem is I keep getting this error:
Could not create constraint. See previous errors.
I am not sure what I am doing wrong, just need a little help.
Thanks
Golgi
-How important does a person have to be before they are considered assassinated instead of just murdered?
Congratulations!
I have a question about Directed acyclic graphs. I am new to Microsoft SQL server coming from MySql. The reason why I am now using MS SQL is the need for nodle graphs in a relational database. I have been reading so much on this, I really need this to work. I have been trying this from and I cannot get anything to work. I am just trying to create a few tables:
Code:
CREATE TABLE nodes (
id INTEGER PRIMARY KEY,
name VARCHAR(10) NOT NULL,
feat1 CHAR(1), -- e.g., age
feat2 CHAR(1) -- e.g., school attended or company
);
CREATE TABLE edges (
a INTEGER NOT NULL REFERENCES nodes(id) ON UPDATE CASCADE ON DELETE CASCADE,
b INTEGER NOT NULL REFERENCES nodes(id) ON UPDATE CASCADE ON DELETE CASCADE,
PRIMARY KEY (a, b)
);
CREATE INDEX a_idx ON edges (a);
CREATE INDEX b_idx ON edges (b);
The problem is I keep getting this error:
Code:
Msg 1785, Level 16, State 0, Line 8
Introducing FOREIGN KEY constraint 'FK__edges__b__628FA481' on table 'edges' may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY constraints.
Msg 1750, Level 16, State 0, Line 8
I am not sure what I am doing wrong, just need a little help.
Thanks
Golgi
-How important does a person have to be before they are considered assassinated instead of just murdered?
Congratulations!