/* Determine what DTS packages were created on the last
@dts_creation_interval
* hours.
*/
IF (SELECT Count(name) FROM msdb.dbo.sysdtspackages
WHERE DATEDIFF(hour,createdate,GETDATE()) <
@dts_creation_interval ) > 0
BEGIN
PRINT 'The following DTS packages have been created within the
past ' +
CONVERT(VARCHAR(10), @dts_creation_interval) + ' hours.'
PRINT ''
SELECT SUBSTRING(name,1,30) AS 'package_name',
SUBSTRING(owner,1,30) AS 'owner',
createdate AS 'creation_date'
FROM msdb.dbo.sysdtspackages
WHERE DATEDIFF(hour,createdate,GETDATE()) <
@dts_creation_interval
END
go
/* Get list of jobs executed on system within the
* past @job_execution_interval hours.
* The CONVERT call is necessary because Microsoft decided to store
* dates in the sysjobhistory table as an INT, but DATEDIFF can't work
on
* an INT.
*/
Declare @job_execution_interval smalldatetime
--
IF (SELECT count(name) FROM msdb.dbo.sysjobs sysjobs,
msdb.dbo.sysjobhistory sysjobhistory
WHERE sysjobs.job_id = sysjobhistory.job_id AND
DATEDIFF (hour, CONVERT(VARCHAR(10),run_date), GETDATE()) <
@job_execution_interval) > 1 BEGIN
PRINT 'The following jobs have been run on this system:'
SELECT SUBSTRING(name,1,50) AS 'Jobs',
run_date as 'Run Date' , count(SUBSTRING(name,1,50)) as
'Times'
FROM msdb.dbo.sysjobs sysjobs, msdb.dbo.sysjobhistory
sysjobhistory
WHERE sysjobs.job_id=sysjobhistory.job_id
AND DATEDIFF (hour, CONVERT(VARCHAR(10),run_date),
GETDATE()) < @job_execution_interval
GROUP BY name, run_date
END
GO
--
print ''
print 'Network Information for Server ' + + @@SERVERNAME print ''
exec master..xp_msver
GO
use master
go
print ''
print 'IPCONFIG'
print ''
go
xp_cmdshell 'ipconfig /all'
go
PRINT ''
Tad Huck
{Database Czar - " If you can't learn to do something well, learn to
enjoy doing it poorly. "}
REAL PAGE INC.
4000 International Parkway
Carrollton, Texas 75007-1913
(972) 820-3432.
This message is intended only for the use of the individual(s) or entity to which it is addressed and may contain information that is privileged, confidential, and/or proprietary to RealPage and its affiliated companies. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, forwarding or copying of this communication is prohibited without the express permission of the sender. If you have received this communication in error, please notify the sender immediately and delete the original message.
MS Sql Server LazyDBA home page