How do I get a list of tables in T-SQL
Is there anything equivalent to Oracle'sSelect * from tab in MS SQL.
Leave a comment...
- 2 Comments
- I have got the answer
select name from sysobjects where type = 'U'#1; Fri, 04 Jan 2008 17:08:00 GMT
- That will work, but try one of these 2 alternate methods to assure forward-compaitbility with future SQL Server versions:
SELECT * FROM INFORMATION_SCHEMA.TABLES
Note that each of the 3 options yields slightly different results as they filter the information differently. Generally sys* tables should not be queried directly as they are subject to chage.
Terri#2; Fri, 04 Jan 2008 17:09:00 GMT