sorry kevin,looks like i didn't put my question in the way that it has to be, Usually if we have master records M1and M2 on master object similarly child records C1 and C2on detail object,both reords C1 and C2 can select the either M1 or M2 record as their master record (through master detail lookup field).
but my requirement is,if M1 is selected as master by C1 record then C2 should not be able to select M1 as its master record,atleast there should be some error message for eg "you can't select this record as master because it has been linked to another record"
So your requirement is every master can have one child only.
If that's the case, then you can create a rollup summary field on the master to store the number of child records, then create a validation rule to restrict its value to not greater than one.
Usually if we have master records M1and M2 on master object similarly child records C1 and C2on detail object,both reords C1 and C2 can select the either M1 or M2 record as their master record (through master detail lookup field).
but my requirement is,if M1 is selected as master by C1 record then C2 should not be able to select M1 as its master record,atleast there should be some error message for eg "you can't select this record as master because it has been linked to another record"