Click here to Skip to main content
15,881,803 members
Articles / Programming Languages / SQL
Article

Database Script Generator

Rate me:
Please Sign up or sign in to vote.
1.92/5 (7 votes)
9 Oct 20061 min read 34.2K   1.2K   20  
This utility can be used to compare two MS Access databases for changes in the data. You have the option of generating the SQL scripts and\or a summary XML

Sample Image - DatabaseScripting.jpg

Introduction

I created this utility for quickly generating the SQL scripts for the changes made to the database. Afterwards, I also added the option to generate the XML which can then be consumed by any application.<o:p>

Mostly we use Access databases for storing the configuration or other information. I came across such situation where I had to change the database. Then to keep track of the changes we use the SQL scripts. To speed up the process I created this utility.<o:p>

Since, I had not used C# before; I developed this utility using C#. So, you may find many issues with the code. But at the end it serves the purpose :-)<o:p>

Also, currently this utility only generates scripts\XML for data changes and not the schema changes.<o:p>

Steps to use:<o:p>

  1. Launch the application <o:p>
  2. Specify the old and new databases <o:p>
  3. Select 'Scripting Options' i.e. whether you want to generate SQL scripts and\or XML file <o:p>
  4. Select the changes you need to consider i.e. rows inserted\deleted\updated <o:p>
  5. In case some tables don't have primary keys you can specify the fields that will uniquely identify the rows using PrimaryKeys.xml. This must be in the same folder as the DatabaseScriptGenerator.exe. (The template is included in the src) <o:p>
  6. The output files will be generated in the same folder as DatabaseScriptGenerator.exe<o:p>

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
-- There are no messages in this forum --