多谢各位!谁能再解释一下,在建立Relationship的时候,底下的几个复选框都什么意思啊?
Check existing data on creation
Enforce relationship for replication
Enforce relationship for INSERTs and Update
Cascade Update Related Fields
Cascade Delete Related Records
Create database cat
go
use cat
go
CREATE TABLE s(s# int not null primary key,s_name varchar(8) not null)
go
CREATE TABLE c (c# int not null primary key,c_name varchar(8) not null)
go
CREATE TABLE cs(c# int not null,s# int not null,cj tinyint not null default(0),
primary key (c#,s#),foreign key(s#) references s(s#),foreign key(c#) references c(c#))
go
--左:
select * from @a Aa left join @b Bb on Aa.a=Bb.a
--右:
select * from @a Aa right join @b Bb on Aa.a=Bb.a
--内
select * from @a Aa join @b Bb on Aa.a=Bb.a
--外
select * from @a Aa full join @b Bb on Aa.a=Bb.a
--完全
select * from @a,@b