Question

How do I get all the names of tables in a specific database on SQL Server?

1 Answers

In SQL Server 2005 or better it is

SELECT * FROM information_schema.tables WHERE TABLE_TYPE='BASE TABLE'

For SQL Server 2000 the syntax is:

SELECT * FROM sysobjects WHERE xtype='U'