title: Can there be constraints with the same name in a DB?
body: <p>This is a follow-on question from the one I asked <a href="https://stackoverflow.com/questions/1397440/">here</a>.</p>
  
  <p>Can constraints in a DB have the same name?</p>
  
  <p>Say I have:</p>
  
  <pre><code>CREATE TABLE Employer
  (
      EmployerCode    VARCHAR(20)    PRIMARY KEY,
      Address         VARCHAR(100)   NULL
  )
  
  
  CREATE TABLE Employee
  (
      EmployeeID      INT            PRIMARY KEY,
      EmployerCode    VARCHAR(20)    NOT NULL,
      CONSTRAINT employer_code_fk FOREIGN KEY (EmployerCode) REFERENCES Employer
  )
  
  
  CREATE TABLE BankAccount
  (
      BankAccountID   INT            PRIMARY KEY,
      EmployerCode    VARCHAR(20)    NOT NULL,
      Amount          MONEY          NOT NULL,
      CONSTRAINT employer_code_fk FOREIGN KEY (EmployerCode) REFERENCES Employer
  )
  </code></pre>
  
  <p>Is this allowable? Does it depend on the DBMS (I'm on SQL Server 2005)? If it is not allowable, does anyone have any suggestions on how to work around it?</p>