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 is the latest version of microsoft sql server?
Do you know what is difference between stored procedure and user defined function?
What is de-normalization and what are some of the examples of it?
Explain activity monitors
Suppose you want to implement the many-to-many relationships while designing tables. How would you do it?
What are the joins in sql server? : sql server database administration
How do I partition a table in sql server?
Why use sub query in sql server and list out types of sub queries?
What are the differences between substr and charindex in sql server.
Please explain that what are the basic functions for master, msdb, model, tempdb and resource databases? : SQL Server Architecture
Which database stores information about replication?
Where is localdb stored?
How many replicas are maintained for each sql azure db?
Can you explain the disadvantages/limitation of the cursor?
What is primary key and example?