Wrox Programmer Forums
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 24th, 2005, 03:12 PM
Registered User
 
Join Date: Nov 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Run/Stop SQLAgent

Hi,

as I can run/stop the services of SQL, OLAP (SQLAgent) by means of commandos T-SQL

Thank,

John

 
Old November 25th, 2005, 12:18 PM
SQLScott's Avatar
Wrox Author
 
Join Date: Dec 2004
Posts: 338
Thanks: 0
Thanked 2 Times in 2 Posts
Default

YOu can start and stop SQL Server engine and the SQL Agent services via the command prompt using NET START and NET STOP. Don't know of a way via T-SQL unless you use the exteneded stored procedure xp_cmdshell.

Scott

 
Old November 25th, 2005, 01:56 PM
Authorized User
 
Join Date: Sep 2005
Posts: 95
Thanks: 0
Thanked 0 Times in 0 Posts
Default

start:
EXEC master..xp_cmdshell 'net start SQLSERVERAGENT'

stop:
EXEC master..xp_cmdshell 'net stop SQLSERVERAGENT'

“I sense many useless updates in you... Useless updates lead to fragmentation... Fragmentation leads to downtime...Downtime leads to suffering..Fragmentation is the path to the darkside.. DBCC INDEXDEFRAG and DBCC DBREINDEX are the force...May the force be with you" -- http://sqlservercode.blogspot.com/





Similar Threads
Thread Thread Starter Forum Replies Last Post
Stop button won't stop loop JDShaffer Visual Basic 2008 Essentials 3 May 23rd, 2008 03:22 PM
How can I run or not run Google AD in my ASP.NET w mycwcgr ASP.NET 2.0 Professional 0 November 5th, 2007 07:18 AM
how to stop run of the project q8z Beginning VB 6 2 October 23rd, 2004 01:12 AM
Cannot stop the process mcinar SQL Server 2000 11 October 20th, 2004 07:39 AM
Stop E-mail SannOo Forum and Wrox.com Feedback 7 June 15th, 2004 05:06 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.