//z 2012-3-16 11:34:36 AM IS2120@CSDN
SQL Server 2005 or 2008:
SELECT * FROM information_schema.tables
SQL Server 2000:
SELECT * FROM sysobjects WHERE xtype='U'
//z 2012-3-16 11:34:36 AM IS2120@CSDN
SQL Server 2005 or 2008:
SELECT * FROM information_schema.tables
SQL Server 2000:
SELECT * FROM sysobjects WHERE xtype='U'
SELECT sobjects.name
FROM sysobjects sobjects
WHERE sobjects.xtype = 'U'
Here is a list of other object types you can search for as well:
SELECT * FROM INFORMATION_SCHEMA.TABLES
or Sys.Tables
exec sp_msforeachtable 'print ''?'''