views:

1427

answers:

4

I just downloaded the developer edition of SQL Anywhere. How can I get a list of tables in the database I'm connected to?. Also for a particular table, how do I get the meta-data for that table (column names, types, etc)?

A: 

I have not used SQL Anywhere for many years however the following SQL should work

select c.column_name from systabcol c key join systab t on t.table_id=c.table_id where t.table_name='tablename'

This was cribbed directly from an earlier question

Steve Weet
+1  A: 

Assuming Windows: start - All Programs - SQL Anywhere 11 - Sybase Central

Then Connections - Connect with SQL Anywhere 11...

Select "ODBC Data Source name" and pick "SQL Anywhere 11 Demo"

Press OK to see a tree view of the various objects in the database (tables etcetera).

Breck Carter
A: 
select * from systable  // lists all tables
select * from syscolumn // lists all tables columns
Zote
A: 

For a particular table:

describe TableName

will return the table's columns, with an indication of the column's type, whether it's nullable and a primary key

Vincent Buck