Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

What is deploy, process and build? : sql server analysis services, ssas

1100


Do you know query execution plan?

1166


What do you need to connect php to sql server?

1102


Can a unique index be created on a column, which contains null?

916


What is the difference between Triggers and Stored Procedure?

1093


Write a program using SQL queries to find a unique entry in a table.

988


What is the difference between stored procedure and user defined functions?

1186


What do you understand by coalesce in sql server?

1069


What is the cpu pressure?

1035


How to access the inserted record of an event?

1045


Mention the differences between having and where clause.

1055


What are the risks of storing a hibernate-managed object in a cache? How do you overcome the problems?

1099


What new data source types were added in ssrs 2014?

160


What is database replication?

1134


Suppose you want to implement the one-to-one relationships while designing tables. How would you do it?

953