title: Unable to delete a row from a table due to a dependency/reference in another table
body: <p>I have a stored procedure that deletes a record from a table where one of the columns matches a specified value:</p>
  
  <pre><code>ALTER PROCEDURE [dbo].[Sp_DelBranch] @datafield varchar(50)
  AS
  BEGIN
      DELETE FROM Branch WHERE branchname = @datafield     
  END
  </code></pre>
  
  <p>Unfortunately I get the following error on execution:</p>
  
  <blockquote>
    <p>The DELETE statement conflicted with the REFERENCE constraint "fk_BranchIdDept". The       conflict occurred in database "MproWorkSpace", table "dbo.Department", column 'BranchId'.</p>
  </blockquote>
  
  <p>Can anyone explain why I'm seeing this error?</p>