Skip to Content
avatar image
Former Member

ISQL DESCRIBE TABLE

Dear experts,

I want to show the script of creation of a specficic table in SAP ERP6 EHP7 on ASE 15.7. i proceded as below :


1> describe table  SAPSR3.ZPAB_ECHANGE

2> go

Msg 156, Level 15, State 2:

Server 'DEV', Line 1:

Incorrect syntax near the keyword 'table'.

I cannot find any documentation which explain how to get creation table script with isql command.

Any help, please ?

Thnaks in advance..

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Jan 12, 2015 at 04:44 PM

    Hi.

    As Mark already said: sp_help in isql will give you a good description of any given database table (but also on most other objects inside the database.

    In an SAP environment you can also check:

    The ABAP DDIC transcations: Tx SE11 -> Enter TableName -> Display

    Then you can navigate to Utilities -> Database Object -> Display which will you show you information on datatypes, nullability, defaults on the DB.

    Or Utilities -> Database Object -> Database Utility (aka SE14): "Storage Parameters" shows you information on compression and partitions

    The easier way to get this information is in DBA Cockpit: Space -> Single Table Analysis shows you close to everything about a given table on the database.

    Both DBACockpit and the DDIC transactions don't show you the SQL used for the creation of the table. But in general you should not create any tables on the database bypassing the DDIC anyway.

    Regards,

    Jan

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 12, 2015 at 04:06 PM

    'describe table' is not a valid command in ASE.

    Try sp_help to get details about a table.  Note however that sp_help does not generate DDL.

    -------------

    isql is a simplistic command line tool that is mostly a pass-through interface to ASE, ie, it has no real functionality of its own.

    What you enter in isql are valid ASE commands.  Unfortunately, ASE does not have any (internal) commands or procs for generating DDL.

    -------------

    To generate DDL you'll need to use an application that can connect to ASE, query the system tables, and build the desired DDL.  Some options:

    - ddlgen : command line, java based tool that comes with ASE

    - (Sybase/SAP) PowerDesigner : used for (among other things) maintaining physical and logical database models; can reverse engineer DDL from ASE

    - Sybase Control Center : NOTE: I don't use this so I'm not 100% sure it can generate DDL

    - 3rd party application : eg, DBArtisan, RabidRapidSQL

    - take a look at the source code for the standard system procs that come with ASE - sp_help, sp_helpconstraint, sp_helpindex, etc - and roll your own SQL (batch or stored proc) to reverse engineer table DDL

    NOTE: While I've worked with ASE for 20+ years, I have no experience with SAP applications (eg, ERP6 EHP7).  Net result is that I don't know if SAP applications have a way of generating the DDL.

    Add comment
    10|10000 characters needed characters exceeded


    • Adding to Mark's list, there is Ed Barlow's collection of stored procedures (shareware, I believe) available on the web that includes one sp__revtable that generated DDL for a table - though I'm not sure the version out there includes all the latest features.  But it would be a good start for creating your own, if nothing else.  Check out. GEM EXTENDED STORED PROCEDURES

      -bret

  • Jan 12, 2015 at 09:43 PM

    Jan is correct in not messing up with the content of your system, but...

    In case you need to extract ddl for you database objects, check the official SAP Sybase documentation on ddlgen and defncopy tools shipped with each ASE installation.  These will do the job for you - much better than sp_help &c.

    HTH,

    Andrew

    Add comment
    10|10000 characters needed characters exceeded