Getting the table structure from SQL Express 2005

time to read 2 min | 212 words

Here are some of the solutions that I've found:

  • GUI tool for scripting the database using SQL-DMO, including the data in it. I didn't use it myself (although I will probably will) but it seems like it can work even on 2005.
  • Scptxfr.exe is a tool that will script the database for you. It's not avialable on SQL Express or in VS 2005, but you can use the file from the big brother install to script a SQL Express database.
  • SQL DMO scripts - by writing the code yourself. There seems to be plenty of references to it, so it shouldn't be much of a problem.

I used the following solution:

  • s_ScriptAllDatabases - this is a store procedure that you can call which will output the structure of the database(s) into a directory.

I'm felling much better now that I can use drop database & create database to refactor my database as well as my code.