|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Stop/Start SQLSERVERAGENT service with Transact-SQLThe easiest way would be to...
master..xp_cmdshell 'net stop mssqlserver' Tony. Show quote "Ben Rum" <bundyru***@yahoo.com> wrote in message news:OdCp4$S4FHA.3628@TK2MSFTNGP12.phx.gbl... > Is this possible? > > No, the easiest way in T-SQL is:
SHUTDOWN Show quote :) -- Show quoteJacco 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? >> >> > > 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' -- Show quoteJacco 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? >>> >>> >> >> > > Both right and both wrong :)
I should read posts more clearly. I forgot about SHUTDOWN, i've never used it. Tony. 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? >>>> >>>> >>> >>> >> >> > > |
|||||||||||||||||||||||