How can I delete a specific row on a table only if its data is not used by another table anymore?
Lets say I have a [schedule] table and [scheduletype] table. If a specific [scheduletype] is not found in [schedule].[type] field of the [schedule] table then it will be removed from the [scheduletype] table.
BTW I am using SQL Server 2005.
Try this (assuming the relevant field is called
idinschedule):