Search code examples
javasqlsybase

Get the list of user defined tables in the specific database


I need to list the name of all tables in the specific database in sybase and then filter these table name according some string in the name.

This gives current database but I can't specify specific database:

select name from sysobjects where type = 'U'

This gives more than tables, it includes trigger and stored procedure:

Select name from sysobjects
WHERE db_name()='pad_orr_db'

Does any body know how to do it and also filter the name of tables by some string in the name for example only the table with the SASSA in the name be displayed?


Solution

  • Select name from db_name..sysobjects where  type ="U"
    

    replace actual database name from db_name.

    type 'U' is for user defined table.