Need a script to print out Jobs in DB

  • Hi does anyone know a script I can use to print all the Jobs in my DB and provide whether they are active or not (even more detail would be great but that is good for now)

  • SELECT

    [name]

          ,[enabled]

          ,[description]

    FROM [msdb].[dbo].[sysjobs]

    John

  • Thanks John exactly what I wanted -- do you have a script that provides the names of all tables in a database and the sizing i.e. table_1, 1gig ect.

  • http://vyaskn.tripod.com/code/sp_show_huge_tables.txt

     

    MohammedU
    Microsoft SQL Server MVP

  • I use this script I wrote:

    Declare

    @SpaceUsed Table ([name] sysname,

    rows

    int,

    reserved

    varchar(50),

    ireserved

    As Cast(Left(reserved, CharIndex(space(1), reserved) - 1) As Int),

    data

    varchar(50),

    idata

    As Cast(Left(data, CharIndex(space(1), data) - 1) As Int),

    index_size

    varchar(50),

    iindex_size

    As Cast(Left(index_size, CharIndex(space(1), index_size) - 1) As Int),

    unused

    varchar(50),

    iunused

    As Cast(Left(unused, CharIndex(space(1), unused) - 1) As Int))

    Insert

    Into @SpaceUsed ([name], rows, reserved, data, index_size, unused)

    Exec

    sp_msforeachtable 'exec sp_spaceused ''?'', ''true'''

    Select

    *

    From

    @SpaceUsed

    Order

    By ireserved Desc


    My blog: SQL Soldier[/url]
    SQL Server Best Practices:
    SQL Server Best Practices
    Twitter: @SQLSoldier
    My book: Pro SQL Server 2008 Mirroring[/url]
    Microsoft Certified Master: SQL Server, Data Platform MVP
    Database Engineer at BlueMountain Capital Management[/url]

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply