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

plss anybody specify tha constrian management system in dbms

1575


How do you use a subquery to find records that exist in one table and do not exist in another?

553


Describe the functionalities that views support.

664


How do indexes help, types?

554


Explain trigger and trigger types?

559






Can you type more than one query in the query editor screen at the same time?

578


What is the difference between DataRow.Delete() and DataRow.Remove()?

742


Explain logical operators in sql server?

572


What is schemabinding a view?

534


explain how to create a new schema in a database? : Sql server database administration

584


What is the rdl file?

88


What are partitioned views?

584


Why we need sql server?

561


What is master database? : SQL Server Architecture

535


How to update values in a table with update statements in ms sql server?

557