Hi
IN below data i want Student Id & Date to be unique
SQL
Student Detail
ID Primary (Identity), Student ID, Join Date , MarksThanks
Hi
IN below data i want Student Id & Date to be unique
Student Detail
ID Primary (Identity), Student ID, Join Date , MarksThanks
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Amit MohantyRank #112 · 20K reputationPosted Apr 5, 2023, 12:49 AM EDT
If you want uniqueness on the combination of Student ID and Date columns in the Student Detail table, you can create a unique constraint or a unique index on those columns.
ALTER TABLE [StudentDetail] ADD CONSTRAINT [UQ_StudentDetail_StudentID_Date] -- Replace with the desired name UNIQUE ([StudentID], [JoinDate]);