Results 1 to 10 of 10
  1. #1
    Join Date
    Feb 2007
    Location
    Chennai, TN
    Posts
    68

    Unanswered: how to get the ddl (create statement) for tables in sybase

    hi,
    can any one help me to get the ddl of the already existing table in sybase. we can use sp_helptext to get the information for triggers, procedures and view.. but for table sp_helptext will not provide us with that information. is there any system procedures available for table?

  2. #2
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    Use ddlgen utility instead
    else consider sp__revtable from www.edbarlow.com Standalone Download
    Last edited by pdreyer; 02-28-07 at 04:51.

  3. #3
    Join Date
    Feb 2007
    Location
    Chennai, TN
    Posts
    68
    Thanks for your reply.. will check it out. still there is no effect sp_revtable. i dont need to use ddlgen. is there any other method
    Last edited by parangiri; 02-28-07 at 08:38.

  4. #4
    Join Date
    Jan 2003
    Location
    Geneva, Switzerland
    Posts
    353
    Also dbschema - see www.midsomer.org (requires perl)

    Michael

  5. #5
    Join Date
    Feb 2007
    Location
    Chennai, TN
    Posts
    68
    thank you. but i need to get the output in sql advantage itself. i should not use any other tools to get the table schema

  6. #6
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    Quote Originally Posted by parangiri
    ...there is no effect sp_revtable...
    That should be 2 underscores. Did you download and create the stored procedure?
    Code:
    isql -U<user> -P<pass> -S<srv> -i revtable.10
    isql -U<user> -P<pass> -S<srv> 
    1> use tempdb
    2> go
    1> create table #t1 (c1 int, ct varchar(20))
    2> go
    1> sp__revtable #t1
    2> go
     -- Table_DDL                                                           
     ---------------------------------------------------------------------- 
     CREATE TABLE  #t1                                                      
     (                                                                      
      c1  int                        NOT NULL,                              
      ct  varchar(20)                  NOT NULL                             
     )                                                                      
    Object does not have any declarative constraints.
    (return status = 1)
    1> drop table #t1
    2> go
    What error message do you get?

  7. #7
    Join Date
    Feb 2007
    Location
    Chennai, TN
    Posts
    68
    should i download any component to access the sp__revtable procedure?. i am using sql advantage and not isql so what changes should i do to get the functionality of sp__revtable.. when i checked with sp_help sp__revtable, it shows Object does not exist in this database. Thank you, atlast i browsed and got the source code for sp__revtable. Thank you very much... source code of sp__revtable in

    http://www.koders.com/noncode/fid05E...spx?s=datediff
    Last edited by parangiri; 03-01-07 at 08:11.

  8. #8
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    Ask your DBA to create this procedure for you
    And start reading (by clicking on the below link)
    Transact-SQL User's Guide
    Chapter 15: Using Stored Procedures

  9. #9
    Join Date
    May 2007
    Posts
    4
    Quote Originally Posted by parangiri
    hi,
    can any one help me to get the ddl of the already existing table in sybase. we can use sp_helptext to get the information for triggers, procedures and view.. but for table sp_helptext will not provide us with that information. is there any system procedures available for table?
    Have you tried Sybase Central (java version)?

  10. #10
    Join Date
    Feb 2002
    Location
    Willy is on vacation
    Posts
    1,208
    Sybase supplies a ddlgen executable should come with your standard install that can reverse engineer all objects.

    Alternatively use Sybase Power Designer and reverse engineer database.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •