Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / DB Engine / SQL Server / March 2008

Tip: Looking for answers? Try searching our database.

T-SQL to List Important SQL 2005 Objects

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rubens - 28 Mar 2008 22:46 GMT
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_helptext 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.
Uri Dimant - 30 Mar 2008 10:32 GMT
Rubens
select * from sys.tables

select * from sys.views

select * from sys.procedures

 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_helptext 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.
Rubens - 30 Mar 2008 15:48 GMT
Thank-you Uri.  This isn't exactly what I was looking for but it will be a help to search these views as well.

Rubens
 Rubens
 select * from sys.tables

 select * from sys.views

 select * from sys.procedures

   "Rubens" <rubensrose@hotmail.com> wrote in message news:%23Gos61RkIHA.5396@TK2MSFTNGP06.phx.gbl...
   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_helptext 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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.