Home All Groups Group Topic Archive Search About

Stop/Start SQLSERVERAGENT service with Transact-SQL

Author
4 Nov 2005 11:07 AM
Ben Rum
Is this possible?

Author
4 Nov 2005 11:23 AM
Tony Rogerson
The easiest way would be to...

master..xp_cmdshell 'net stop mssqlserver'

Tony.

--
Tony Rogerson
SQL Server MVP
http://sqlserverfaq.com - free video tutorials


Show quote
"Ben Rum" <bundyru***@yahoo.com> wrote in message
news:OdCp4$S4FHA.3628@TK2MSFTNGP12.phx.gbl...
> Is this possible?
>
>
Author
4 Nov 2005 12:17 PM
Jacco Schalkwijk
No, the easiest way  in T-SQL is:
SHUTDOWN

Show quote
:)

--
Jacco Schalkwijk
SQL Server MVP


Show quote
"Tony Rogerson" <tonyroger***@sqlserverfaq.com> wrote in message
news:OUzOgFT4FHA.3444@tk2msftngp13.phx.gbl...
> The easiest way would be to...
>
> master..xp_cmdshell 'net stop mssqlserver'
>
> Tony.
>
> --
> Tony Rogerson
> SQL Server MVP
> http://sqlserverfaq.com - free video tutorials
>
>
> "Ben Rum" <bundyru***@yahoo.com> wrote in message
> news:OdCp4$S4FHA.3628@TK2MSFTNGP12.phx.gbl...
>> Is this possible?
>>
>>
>
>
Author
4 Nov 2005 12:31 PM
Jacco Schalkwijk
Correct answer to the wrong question:

The easiest way to stop SQL Server in T-SQL is: SHUTDOWN
The easiest way to stop SQL Server Agent in T-SQL is: EXEC
master.dbo.xp_cmdshell 'net stop sqlserveragent'

--
Jacco Schalkwijk
SQL Server MVP


Show quote
"Jacco Schalkwijk" <jacco.please.re***@to.newsgroups.mvps.org.invalid> wrote
in message news:%23%23orBoT4FHA.3844@TK2MSFTNGP10.phx.gbl...
> No, the easiest way  in T-SQL is:
> SHUTDOWN
>
> :)
>
> --
> Jacco Schalkwijk
> SQL Server MVP
>
>
> "Tony Rogerson" <tonyroger***@sqlserverfaq.com> wrote in message
> news:OUzOgFT4FHA.3444@tk2msftngp13.phx.gbl...
>> The easiest way would be to...
>>
>> master..xp_cmdshell 'net stop mssqlserver'
>>
>> Tony.
>>
>> --
>> Tony Rogerson
>> SQL Server MVP
>> http://sqlserverfaq.com - free video tutorials
>>
>>
>> "Ben Rum" <bundyru***@yahoo.com> wrote in message
>> news:OdCp4$S4FHA.3628@TK2MSFTNGP12.phx.gbl...
>>> Is this possible?
>>>
>>>
>>
>>
>
>
Author
4 Nov 2005 1:52 PM
Tony Rogerson
Both right and both wrong :)

I should read posts more clearly.

I forgot about SHUTDOWN, i've never used it.

Tony.

--
Tony Rogerson
SQL Server MVP
http://sqlserverfaq.com - free video tutorials


Show quote
"Jacco Schalkwijk" <jacco.please.re***@to.newsgroups.mvps.org.invalid> wrote
in message news:OlvH$vT4FHA.1188@TK2MSFTNGP12.phx.gbl...
> Correct answer to the wrong question:
>
> The easiest way to stop SQL Server in T-SQL is: SHUTDOWN
> The easiest way to stop SQL Server Agent in T-SQL is: EXEC
> master.dbo.xp_cmdshell 'net stop sqlserveragent'
>
> --
> Jacco Schalkwijk
> SQL Server MVP
>
>
> "Jacco Schalkwijk" <jacco.please.re***@to.newsgroups.mvps.org.invalid>
> wrote in message news:%23%23orBoT4FHA.3844@TK2MSFTNGP10.phx.gbl...
>> No, the easiest way  in T-SQL is:
>> SHUTDOWN
>>
>> :)
>>
>> --
>> Jacco Schalkwijk
>> SQL Server MVP
>>
>>
>> "Tony Rogerson" <tonyroger***@sqlserverfaq.com> wrote in message
>> news:OUzOgFT4FHA.3444@tk2msftngp13.phx.gbl...
>>> The easiest way would be to...
>>>
>>> master..xp_cmdshell 'net stop mssqlserver'
>>>
>>> Tony.
>>>
>>> --
>>> Tony Rogerson
>>> SQL Server MVP
>>> http://sqlserverfaq.com - free video tutorials
>>>
>>>
>>> "Ben Rum" <bundyru***@yahoo.com> wrote in message
>>> news:OdCp4$S4FHA.3628@TK2MSFTNGP12.phx.gbl...
>>>> Is this possible?
>>>>
>>>>
>>>
>>>
>>
>>
>
>

AddThis Social Bookmark Button