Search code examples
sqlsql-server-2008asp.net-mvc-4

Table of comments structure


I develop web-site. Database has many tables like "News", "Blogs" etc. So, I have to add comments functionality. Can you advice how I can realize that? Should I store comments for different tables into single "Comment" table and what is the structure of those table? Or should I create multiple tables, for example: "News" -> "News_comments", "Blogs" -> "Blogs_comments"?

Thank you.


Solution

  • One table only, with a column identifying the type of comment. Having multiple tables for the same purpose is just maintainace nightmare. One table is good enough.