which query u can write to sql server doesn't work
inbetween 7.00PM to nextday 9.00AM
Answer Posted / sarvesh
CREATE PROCEDURE usp_StartStop_services
AS
Begin
Declare @date as varchar(100)
SET @date = convert(varchar, getdate(), 114)
Print @date
if @date >= '19:00:00.000'
exec MASTER.DBO.xp_cmdshell 'NET Stop SQLSERVER'
Else if
@date >= '09:00:00.00' and @date < '19:00:00.000'
exec MASTER.DBO.xp_cmdshell 'NET START SQLSERVER'
END
GO
| Is This Answer Correct ? | 19 Yes | 0 No |
Post New Answer View All Answers
What are the new features of sql server 2008 r2 reporting service?
what is blocking? : Sql server database administration
Ways to improve the performance of a SQL Azure Database?
Can you explain the disadvantages/limitation of the cursor?
What is a benefit of using an after insert trigger over using a before insert trigger?
How to manipulate data from one table to another table ?
How would you choose between a clustered and a non-clustered index?
What part does database design plays a role in performance of an sql server-based application?
What is an identity column in insert statements?
Define msdb database?
What is executereader?
What is best institute to Learn DotNET And SQL in chennai?
What is the Disadvantage of indexed sequential file.
What are the basic functions for master, msdb, model, tempdb and resource databases? : SQL Server Architecture
How does the report manager work in SSRS?