SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

SQL Agent job to show SQL Server service details upon agent restart

By Haden Kingsland (theflyingdba),

This script is being offered for public use and as such is being offered as untested and unverified. Please use this script at your own risk, as I take NO responsibility for it's use elsewhere in environments that are NOT under my control. Redistribution or sale of the code, in whole or in part, is prohibited! Always ensure that you run such scripts in test prior to production and perform due diligence as to whether they meet yours, or your company needs! Description : To show sql and physical server details upon instance restart so that we have visibility of unexpected issues with servers and services. The Windows uptime.exe executable MUST be installed in the Windows\System32 area of the O/S for this to work, and xp_cmdshell must be configured for this to be run! The calling SQL Agent job Schedule Type must be set to ... "Start automatically when SQL Server Agent starts" so that the job runs upon instance startup. This script is invoked by the following named SQL Agent job in all instances ... "Report Server/Service Status upon system restart" This procedure uses the following extended stored procedures ... xp_servicecontrol (undocumented procedure -- Use with care!!) xp_regread xp_cmdshell

Total article views: 550 | Views in the last 30 days: 1
 
Related Articles
FORUM

Moved Instance - now SQL Agent will not Start (Agent XPs disabled)

Moved instance over to new drive and SQL Server Agent won't work

SCRIPT

Script to document SQL Instance Details

SQL Script to document instance details

ARTICLE

SSIS Package to Script All SQL Server Jobs to Individual Files

The provided SSIS package contains a single script task that will script all SQL Server 2000/2005/20...

FORUM

Scripting Stored Procedures

Scripting Stored Procedures

FORUM

SQL Server Agent jobs

T-SQL script SQL Server Agent Jobs

Tags
configuration    
sql agent    
 
Contribute