Can there be constraints with the same name in a DB?

后端 未结 6 1264
逝去的感伤
逝去的感伤 2020-12-10 00:39

This is a follow-on question from the one I asked here.

Can constraints in a DB have the same name?

Say I have:

CREATE TABLE Employer
(
    E         


        
6条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-10 00:51

    Does it depend on the DBMS (I'm on SQL Server 2005)?

    Yes, apparently it does depend on the DBMS.

    Other answers say it's not permitted, but I have a MS SQL CE ("Compact Edition") database in which I accidentally successfully created two FK contraints, in two tables, with the same contraint name.

提交回复
热议问题