create table tblA
(
id int identity(1,1) primary key,
name varchar(50) not null,
CountryId int not null
)create table tblB
(id int identity(1,1) primary key,
countryname varchar(25) not null
)alter table tblA add constraint tblA_CountryId_FK
foreign key (CountryId) references tblB(id)
How i can now add values to tblA and tblB?
If i try get an error :
The INSERT statement conflicted with the FOREIGN KEY constraint "tblA_CountryId_FK". The conflict occurred in database "Sample", table "dbo.tblB", column 'id'.
Thanks :)
Massimo
www.Photoballot.net