I want only one row of FamilyMember records and in FamilyHead related to FamilyID
here all records are deleted....
how can i solved ....this
ALTER PROCEDURE [dbo].[spDeleteParivarRegisterDetails]
@FamilyMemberID int,
@IsDeleted bit output
AS
DELETE FROM FamilyMember
FROM FamilyMember
LEFT JOIN FamilyHead ON FamilyHead.FamilyID = FamilyMember.FamilyID
WHERE FamilyMember.FamilyMemberID=@FamilyMemberID
select'Record Deleted'
SET @IsDeleted=1
-------------------
Table Senario.....
Sir,
FamilyHead having family id as a primary key and Head name only consider FamilyID, HouseNo, WardNo, District and
FamilyMember having FamilyID as relationship with FamilyHead and FamilyMemberID is primary Key and all coulmn name like MemberName,age,sex,qulifaication dateofbirth etc
....
Sir, table resultan data this type
FamilyHead
FamilyID HeadName HouseNo Ward District
1 XXX 516A 1 GZB
FamilyMember
FamilyMemberID ActiveHead MemberName Age Sex Qualifacation FamilyID
1 1 XXX 41 M MCA 1
2 0 AAA 32 F B-Tech 1
3 0 BBB 25 F MCA 1
4 0 CCC 22 M MBA 1
So, Here i want to delete row of Family Member and when Head Check =1 then FamilyHead also deleted the row...but when use FamilyID is select delete all records...how can i solve..