February 7, 2007 at 9:26 am
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)
February 7, 2007 at 9:31 am
SELECT
[name]
,[enabled]
,[description]
FROM [msdb].[dbo].[sysjobs]
John
February 7, 2007 at 12:00 pm
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.
February 7, 2007 at 4:44 pm
February 8, 2007 at 4:32 pm
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
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply