I know after Reading This U will also this about it ,but if u want to know please upvote and help to me to solve
Suppose I have Two tables
Table A=Student
Table B=Department
Table A:
CREATE TABLE student
(
StudentId INT IDENTITY PRIMARY KEY,
Name VARCHAR(255),
DepartmentId VARCHAR(255),
);
INSERT INTO student VALUES ('nav',1);
INSERT INTO student VALUES ('Angra',2);
INSERT INTO student VALUES ('navjot',3);
Table B:
CREATE TABLE department
(
ID INT PRIMARY KEY,
DeptName VARCHAR(255),
studentId int unique foreign key references Student(StudentId)
);
INSERT INTO dbo.department VALUES (101, 'CSE', 1);
INSERT INTO dbo.department VALUES (102, 'Mech', 2);
INSERT INTO dbo.department VALUES (103, 'Civil', 1);
Now the Question Is ::
Can I Insert upper values in Table B,I know Most of u will Say no,
but suppose I have Rquirement To do it how it is possible without removing Unique Constraint.
Please If Anybody have any idea ,Please share as soon as poosible
Please upvote this question so that I get good answers from experts ,
5 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.

Jayesh VaghasiyaPosted Aug 29, 2018, 5:26 AM
Navjot AngraPosted Aug 24, 2018, 6:01 AM
Jignesh KumarPosted Aug 24, 2018, 1:34 AM
Navjot AngraPosted Aug 24, 2018, 12:30 AM
Jignesh KumarPosted Aug 24, 2018, 12:06 AM