Afficher un message
Vieux 28/03/2008, 22h46   #1
Rubens
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut T-SQL to List Important SQL 2005 Objects

I am wondering if anyone has created T-SQL that lists various categories of SQL 2005 objects that quickly lists them. For example, if I wanted to see all the system objects that were related to triggers or if I wanted to see all objects related to constraints. Basically a breakdown of a lot of the useful objects a DBA can use for daily administration (indexes, database mail, SQL jobs, database mirroring etc. etc. etc.).

In essence I'm looking for something to arm me for my day-to-day tasks when its not always easy to remember all of the built-in views / proc's available to us. An example...

-- Display all mail related objects
select [name], type, type_desc
from msdb.sys.objects
where type in
(
'P', -- Stored Procedure
'V', -- View
'S', -- System Table
'U', -- User Table
'V' -- View
)
and [name] like '%mail%'
order by type, [name]

Thank-you,
Rubens

P.S. The reason I thought about this was because I came across sp_text which I had completely forgotten about and can be very useful to see how / what Microsoft is doing with some of their built-in code.
  Réponse avec citation
 
Page generated in 0,04944 seconds with 9 queries