Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
markshen2006
Starting Member
15 Posts |
Posted - 2008-04-05 : 00:58:10
|
| Hi,I have a database that have two handred tables.I want to get all the table name list.Would you please help me if you know how to do this (query or build-in stored procedure).ThanksMark |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2008-04-05 : 01:00:08
|
| sp_tablesorselect name from sysobjectswhere type='U' |
 |
|
|
snSQL
Master Smack Fu Yak Hacker
1837 Posts |
Posted - 2008-04-05 : 01:06:21
|
| In SQL Server 2005 you should use sys.objects rather than sysobjects (sorry being picky). Also, consider the information schema view INFORMATION_SCHEMA.TABLES. |
 |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2008-04-05 : 01:10:46
|
| who said that? Try it and see. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-04-05 : 02:17:40
|
quote: Originally posted by sodeep who said that? Try it and see.
For backward support, SQL Server 2005 supports sysobjects as well. But sys.objects has more columnsAlso why are you using different font style for your postings as forum's default is more readable MadhivananFailing to plan is Planning to fail |
 |
|
|
jackv
Master Smack Fu Yak Hacker
2179 Posts |
Posted - 2008-04-05 : 03:20:26
|
| Sysobjects has been retained for backward compatibilityJack Vamvas--------------------Search IT jobs from multiple sources- http://www.ITjobfeed.com |
 |
|
|
rmiao
Master Smack Fu Yak Hacker
7266 Posts |
Posted - 2008-04-05 : 22:39:48
|
| Have to call it sys.sysobjects. |
 |
|
|
snSQL
Master Smack Fu Yak Hacker
1837 Posts |
Posted - 2008-04-05 : 23:06:25
|
quote: Originally posted by sodeep who said that? Try it and see.
I didn't say you must use sys.objects, I said you should use sys.objects, and who said that - SQL Server Books Online, see the topic on sysobjects, it says quote: This SQL Server 2000 system table is included as a view for backward compatibility. We recommend that you use the current SQL Server system views instead.
|
 |
|
|
|
|
|