in reply to Database Table Names

This is getting a little repetitive

In SQL Server 2000 you can get a list of table names very simply -

select name from sysobjects where xtype = 'U'

If you know how to run a SQL query you will have no trouble using this code to get a list of tables.

For the sake of portability it might also be useful to note that ANSI SQL-92 provides a standard for querying table schema information:
select TABLE_NAME from INFORMATION_SCHEMA.TABLES

See also this discussion started by gmax, particularly this node which has more relevant info.

Replies are listed 'Best First'.
Re: Re: Database Table Names
by tilly (Archbishop) on Nov 08, 2003 at 16:59 UTC
    And, praytell, what level of compliance with ANSI SQL-92 requires INFORMATION_SCHEMA.TABLES to exist, and which databases provide it? Remember that vendors are allowed to declare compliance with the standard when they have only complied with a fairly small subset of the features it specifies.

    For the record, I just grabbed a connection to the first thing that came to hand (Oracle 8) and found that it does not support this. Portability obviously doesn't mean portable to THAT...

    Also please edit your post to use relative URLs rather than absolute ones. See Warn people who have perlmonks in a URL? for more on that.