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


Please Help Members By Posting Answers For Below Questions

Explain the difference between control flow and data flow?

701


What is transact-sql ddl trigger?

810


What is the difference between inner join and equi join?

680


What do you mean by table and field in sql?

738


What is dbcc?

887






Difference between connected and disconnected database in .net with sql server?

769


Can you change the data type of a column in a table after the table has been created? If so, which command would you use?

799


Explain something about security and SQL Azure?

106


What are pages and extents? : SQL Server Architecture

711


Explain what is the use of custom fields in report?

689


How many instances per computer are there in sql server 2000?

760


How to get a list all databases on the sql server?

774


How do database indexes work?

716


How can I add Reporting Services reports to my application?

105


Tell me about normalization in DBMS.

752