Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2004
    Posts
    61

    Unanswered: Get system objects

    Hi All,

    I want to get system objects
    Ex: tables, functions, procedures,...
    Like "select * from sysobjects in MSSQL"
    In order to drop a table before I create a table if it was created.

    How can I do in Sybase?
    Please help me.

    Thanks in advance
    Thi Nguyen

  2. #2
    Join Date
    Jul 2004
    Posts
    4
    Use can use the same sysobject where tables,procs,triggers are separted by type field as U,P,TR respectivly in sybase

  3. #3
    Join Date
    Jul 2004
    Posts
    61
    I already found out systables and sysprocedures tables.

    Thanks for your help
    Thi Nguyen

  4. #4
    Join Date
    Jan 2004
    Posts
    545
    Provided Answers: 4
    Quote Originally Posted by thinguyen
    I already found out systables and sysprocedures tables.

    Thanks for your help
    Thi Nguyen
    Try this:

    if exist (select * from sysobjects where name="<putyourobjectnamehere>" and type="<putthetypeoftheobjecthere>")
    begin
    drop <procedure/table/view/etc> <nameoftheobject>
    end

    create object-script

    This should work.
    If you want you can omit the where-clause for the type.
    I'm not crazy, I'm an aeroplane!

  5. #5
    Join Date
    Jul 2004
    Posts
    61
    thanks very much Martijnvs

    it's very helpfull.

    Thi Nguyen

  6. #6
    Join Date
    Jan 2004
    Posts
    545
    Provided Answers: 4
    Quote Originally Posted by thinguyen
    thanks very much Martijnvs

    it's very helpfull.

    Thi Nguyen
    You're welcome .
    I'm not crazy, I'm an aeroplane!

Posting Permissions

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