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
Why I can not enter 0.001 second in date and time literals in ms sql server?
List down some advantages of sql stored procedure?
What is optimization and its types?
What is explicit mode in sql server?
what exactly sql injuction.how to overcome.....
How to add the custom code in Report?
what are the different stages of Report Processing?
What is checkpoint process in the sql server?
How to apply filtering criteria at group level with the having clause in ms sql server?
Explain error handling in ssis?
How do I create a partition table in sql server?
What command do we use to rename a db, a table and a column?
Can a table have 2 foreign keys?
Can group by and orderby be used together?
what is a traditional network library for sql servers? : Sql server database administration