Blogging database scripts


For a while now I’ve been using a blogging database for demos, presentations, videos etc.


For example I used my little blogging database for the Getting Started with the Entity Framework video I did.


Every time I do something with this database I invariably get asked by people if they can have a copy of the scripts.


So here they are.


Attachments:
I’ve used numerous variations on the basic database structure over time, here are the two key variations, zipped together and attached:



  • Blogging.sql: is a very basic model with no inheritance, although it does include a number of stored procedures, some of which demonstrate how you can use stored procedures to do things like auditing etc. This is the script used in the EF intro video.

  • Blogging_TPT.sql: Introduces TPT inheritance to the database.

Caveats: 
These databases don’t necessarily represent best practices, for example in the Blogging.sql database the PK of the Blogs table is a string, which is the URL of the blog, this is not exactly recommended, and we used only to illustrate that EF can handle this sort of legacy database scenario just fine.

BloggingDatabases.zip