Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

list all tables from a database in syBase

In sql server 2012 i'm using

USE myDatabase;
GO
SELECT  *
FROM    sys.objects
WHERE   type = 'U';

Is it possible to do the same in syBase ?

like image 995
CM2K Avatar asked Dec 09 '22 01:12

CM2K


1 Answers

In order to get a list of all tables in the current database, you can filter the sysobjects table by type = ‘U’ e.g.:

select convert(varchar(30),o.name) AS table_name
from sysobjects o
where type = 'U'
order by table_name

Further Reference

Here is an example of getting all table names in MSSQL or SQL Server database:

USE test; //SELECT DATABASE
SELECT table_name FROM information_schema.tables WHERE table_type = 'base table'

or you can use sys.tables to get all table names from selected database as shown in following SQL query

USE test; //SELECT DATABASE
SELECT * FROM sys.tables

That's all on how to find all table names from database in SQL Server.

like image 189
Anantha Raju C Avatar answered Jan 13 '23 20:01

Anantha Raju C