Create the tpc-h database schema for SQL Server

Last time we created some test data with the tpc-h tool. This time i just want to post a short t-sql to create the database schema.

The roadmap is fairly simple:

  • create all tables in a database
  • insert the test data
  • create primary keys and foreign keys

Some short information:

  • We insert the data before creating the constraints because it’s easier and should be faster.
  • You can also use the files „dss.ddl“ and „dss.ri“ in the dbgen-folder from the tpc-h installation, all tables and constraints are described there.

Just to remember, here is an entity-relationship-diagram of the tpc-h database schema again.

tpc-h ER-Diagram

1. Create the tables with the following script. Remember to use the correct database.

2. Import the test data which we created the last time, for example with the „SQL Server Import and Export Wizard“.

3. Use the following script to create the table relations.

 

Social tagging: > > > > >

Schreibe einen Kommentar