Tag Info

New answers tagged


Another reason why you should use CONSTRAINTs instead of some inside-application-code: What happens if a developer / dba use an insert / update / delete statement to modify the data direct in the DB? In this case all your nice application based referential integrity will be useless. I know, some devs like the possibility to modify data direct without ...


You cannot create the contraint on A.actual_id because it may contains NULLs and there is no PK or unique index. I didn't touch B because you said you cannot change it. Here is what I did. It may work for you: Create A_data where <> 0, Create A_null when = 0 and your Table B Create Table dbo.A_data ( full_id INTEGER NOT NULL PRIMARY KEY, ...

Top 50 recent answers are included