Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 6 of 6 total
Thread Database Structure Generator
Sat, Jan 19 2019 4:48 PMPermanent Link

Charalampos Michael

Hello,
 Anyone knows an easy way/application to generate SQL which it will "upgrade" the structure of a target Table/Database from a Source Table/Database ?

Thank you
Sun, Jan 20 2019 2:46 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Charalampos


Depends on a number of factors - main one is easy for you or easy for the user Smiley

Lets say tables Old & New.

If you're altering Old -> New imn EDBManager you can just go to SQL History and grab the alter table code from there.Wrap it up in something nice so the user can't alter the SQL and job done - just run it.

You can look at the database reverse engineer facility is EDBManager - it has an upgrade capability - again grab the sql and take which bits you want.

If you want a general purpose one then the information is all in the Information databases but you'll have to write the code to extract the table information, compare the two and generate the SQL.

Roy Lambert
Sun, Jan 20 2019 5:49 PMPermanent Link

Steve Gill

Avatar

Hi Charalampos,

Here is the process I use, which is mostly automated.

1.  Reverse engineer the source database.
2.  Save the script.
3.  Create a new session and name it Release Build.  (I actually have a session called Master Build which I just copy as it has all of the parameters already set)
4.  Copy any external module DLLs to the Config folder.
5.  Run the CreateModules.sql script.  (This registers the modules)
6.  Create the database.
7.  Run the reverse engineered script against the new database.
8.  Run the SetupDatabase.sql script. (This creates a couple of system accounts and changes the password of the default Administrator user)
9.  Open the database and run the SETUP_DATABASE stored procedure. (This creates some jobs, sets some system defaults, sets up some lookup tables, etc.)
10. Run the ForceCreation.sql script. (This forces the creation of all database objects)
11. Close the Release Build session.

The database files are distributed with the software.  The setup program copies them to a specific folder.  When the setup program finishes installing the updated application files it runs a program that updates the existing database by using the TEDBReverseEngineer component to create an update script.  The update script is then run against the existing database.  The database files distributed with the software are then deleted.

There are quite a few other things that are done as part of this process but they are specific to my software.

Hope that helps.

= Steve
Tue, Jan 22 2019 6:23 AMPermanent Link

Charalampos Michael

Nice Smile

Thank you guys for the information!
Tue, Jan 22 2019 11:34 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Michael,

<< Anyone knows an easy way/application to generate SQL which it will "upgrade" the structure of a target Table/Database from a Source Table/Database ? >>

Sure, you can do this in the EDB Manager:

1)  Select a Database and right-click/select Reverse-Engineer Database.

2)  Select Upgrade as the type of reverse-engineer to execute on the General tab.

3) Select the target database under the Upgrade Options tab.

4) Specify any additional options under the Output tab.

4) Click on the OK button to begin the reverse-engineering.

Tim Young
Elevate Software
www.elevatesoft.com
Thu, Jan 24 2019 3:47 AMPermanent Link

Charalampos Michael

That Reverse-Engineer Database is awesome!!! Smile
Image