1

I've a Sybase database where I will make a LOT of changes, and I would like to make my changes (currently using PowerDesigner 16), save it as .SQL then generate a .SQL to migrate my initial database to the new database structure.

I don't care about the data, I just want to update the structure with this script.

Any idea how to create this script?

EDIT: It has nothing to do with the given "duplicate", the other ticket is speaking on how to export the sql for SP/... In my case I only want the difference between the two sql

J4N
  • 19,480
  • 39
  • 187
  • 340
  • possible duplicate of [Extract SP and DDL Scripts in sybase Server](http://stackoverflow.com/questions/15081975/extract-sp-and-ddl-scripts-in-sybase-server) – Mike Gardner Apr 14 '15 at 02:22

2 Answers2

2

If you don't have one, you can create a model from your initial database, with File > Reverse Engineer > Database.

Create a copy of this model with File > Save As (as type Archived PDM), say copy.apm.

Then modify the model as you wish.

Then use Database > Apply Model Changes to Database, using the option Using an archive model (select the above copy.apm), to generate the ALTER script.

pascal
  • 3,287
  • 1
  • 17
  • 35
  • I did only an initial test, but this seems to be EXACTLY what I need :) I feel dum to not have found this before :) – J4N Apr 14 '15 at 05:14
0

Anybody looking for a program agnostic way of generating the DDL for a database could use the ddlgen program that comes with ASE

See http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc30191.1572/html/utilityguide/CHDBBGGC.htm

So to create the DDL of database pubs2, you could do something like

ddlgen -Usa -Ppassword123 -SSERVERNAME -TDB -Npubs2 -Ooutput_file.sql
Andy E
  • 508
  • 8
  • 15