SQL 2000: Listing tables in a database

Here's a handy little script which should return all of the user tables in a database:



SELECT name
FROM sysobjects
WHERE (xtype = 'U')
ORDER BY name

You can modify the xtype value in the WHERE clause to return other information, such as 'V' for views, and 'S' for system tables.