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
 General SQL Server Forums
 New to SQL Server Programming
 List of tb, vw... of a databases

Author  Topic 

shifis
Posting Yak Master

157 Posts

Posted - 2008-07-14 : 12:00:56
What is the instruction to obtain the list of tables, functions, triggers,etc, of an specific data bases on SQL Server 2005.

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-07-14 : 12:08:50
quote:
Originally posted by shifis

What is the instruction to obtain the list of tables, functions, triggers,etc, of an specific data bases on SQL Server 2005.



Use this:

select name,type from sys.sysobjects
where type in('TF','U','P','TR','V')
order by type
Go to Top of Page

shifis
Posting Yak Master

157 Posts

Posted - 2008-07-14 : 12:44:42
Thanks!
Where can add a column with the databases of the objects?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-07-14 : 13:07:35
quote:
Originally posted by shifis

Thanks!
Where can add a column with the databases of the objects?


didnt get you...add column to what? each object?
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-07-14 : 19:57:13
quote:
Originally posted by shifis

Thanks!
Where can add a column with the databases of the objects?



This is for one database. If you want for all databases, you have to use sp_Msforeachdb @command1............
Go to Top of Page
   

- Advertisement -