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.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 list all tables ans SP

Author  Topic 

magmo
Aged Yak Warrior

558 Posts

Posted - 2008-05-25 : 12:09:42
Hi

can I through a script retrieve a list af all tables and stored procedure in a database?

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-05-25 : 14:11:50
select name from sys.sysobjects where xtype in ('u', 'p')
Go to Top of Page

mdubey
Posting Yak Master

133 Posts

Posted - 2008-05-26 : 19:59:30
This is your expacted query

select * from sysobjects
where xtype = 'u'

Manoj
MCP, MCTS
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-05-26 : 20:40:07
That doesn't give you sps in the db.
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-05-26 : 22:08:12
Looks like he doesn't see what other has posted.
Go to Top of Page

magmo
Aged Yak Warrior

558 Posts

Posted - 2008-05-26 : 23:46:54
Great, thanks for all help!
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-05-27 : 03:19:02
or

select * from sys.tables
select * from sys.procedures


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -