SPSS (Structural Package for Social Sciences) is a commercial data analysis program from IBM. SPSS for Macintosh is an older version of SPSS for Windows.
Get unlimited access to over 2,000 enterprise-level Business Tools, Applications, Data, SPSS Data. It offers a robust package of professional statistical, data mining and. SPSS Statistic: Statistical Package for Social Sciences. Download:. 9.0-PSS.Q:
How to set security requirement for foreign key in SQL Server?
My table name is Employee and I have the following relationship for creating FK
Create Table #TEMP(ID int, NAME varchar(50), AGE varchar(20));
Insert into #TEMP(ID,NAME,AGE) Values(1, 'JOHN', 30), (2, 'MONICA', 25), (3, 'TOM', 20);
Create Table #Dependent(ID int, TYPE varchar(20), DEP varchar(20));
Insert into #Dependent(ID,TYPE,DEP) Values(1, 'WORKER', 1), (1, 'SALESMAN', 2), (2, 'EMPLOYEE', 1), (3, 'SALESMAN', 2);
CREATE TABLE Employee(
ID int,
NAME varchar(50),
AGE int);
ALTER TABLE #Dependent
ADD CONSTRAINT FK_dependent
FOREIGN KEY(ID)
REFERENCES Employee(ID);
This create above relationship successfully and it's working fine.
If I remove the validation from the create table Employee constraint then it is also working fine.
But when I am try to make this relationship Security set to two-way only then it gives me the following error
Msg 1783, Level 16, State 0, Line 1
There are no primary or candidate keys in the referenced table 'Employee' that match the referencing column list in the foreign key 'FK_dependent'.
So is there any way to make this relationship security set to two-way only.
A:
The error is self-explanatory. There is no Employee.ID column in your dependent table, but it has to have one in order for a foreign key relationship to work.
Change the Employee table to this:
CREATE TABLE Employee ac619d1d87
Related links:
Comments