I have a query
UPDATE dbo.M_Room
SET
//do something
WHERE PK_RoomId= @RoomId AND IsActive=1 AND FK_DepartmentId =@DepartmentId
Now suppose PK_RoomId is my Pk of M_Room and is autoincremented field. So according to this I could have used
WHERE PK_RoomId= @RoomId
rather than
WHERE PK_RoomId= @RoomId AND IsActive=1 AND FK_DepartmentId =@DepartmentId
What all threats I could overcome if I use the second condition rather than 1st one. If we don't have any relationship/Constraints(PK, FK etc.) physically exists and cant implement due to unmanaged structure of database.
What will be your recommendation in such scenario. What all things should be done to keep data consistent.