While creating the answer for Database Diagram of Stack Exchange model? I was looking for the schema information stored in the SEDE database. The sys.tables and sys.columns are populated but when I was looking for the foreign-key constraints I found the sys.foreign_keys table to be empty.

I assume that is because it doesn't add much value to a read-only database schema to have referential constraints defined and it would require extra care when importing data but would it actually harm useability if we have them?

I now use this query to list foreign-key relations but if that information is added to the db we can generate part of the db schema post and annotate it with the relations, it could help new users to understand the schema better and I could use it in the ERD generation script (or someone could create an even more awesome way).

Can we consider to add the foreign-key-constraints to the SEDE databases?


You must log in to answer this question.

Browse other questions tagged .