problem extracting column names for a sybase table

Question : problem extracting column names for a sybase table

 When I use:
SELECT * from syscolumns
WHERE id = object_id(‘mytable’)

I get an error message “Table name ‘syscolumns’ is ambiguous.”

Any ideas?  The table must exist, so my syntax might be wrong.


Solution: problem extracting column names for a sybase table

If you have multiple databases, try prefacing syscolumns with the database name, as in dbname.syscolumns.

Alternatively, try using the sp_columns system stored procedure instead here .