Adding foreign key to existing table gives error 1050 table already exists

后端 未结 9 1145
栀梦
栀梦 2021-01-07 18:11

I\'ve a table CustomizationSet with the columns:

customization_set_guid (which is a non-nullable guid and also the primary key)
creator_account_guid
and a fe         


        
9条回答
  •  感情败类
    2021-01-07 18:55

    I had a similar problem and in the end it was a problem of Integrity Constraint. The Foreign Key column was referencing a foreign column that didnt exist.

    Try run the following to test whether this is the case:

    select r.customization_set_guid, c.customization_set_guid
    from Registration r
    right join CustomizationSet c
    on 
    r.customization_set_guid = c.customization_set_guid
    where isnull(c.customization_set_guid);
    

提交回复
热议问题