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

Why I can not enter 0.001 second in date and time literals in ms sql server?

1045


List down some advantages of sql stored procedure?

946


What is optimization and its types?

953


What is explicit mode in sql server?

1042


what exactly sql injuction.how to overcome.....

2516


How to add the custom code in Report?

126


what are the different stages of Report Processing?

135


What is checkpoint process in the sql server?

1006


How to apply filtering criteria at group level with the having clause in ms sql server?

983


Explain error handling in ssis?

1002


How do I create a partition table in sql server?

1090


What command do we use to rename a db, a table and a column?

910


Can a table have 2 foreign keys?

889


Can group by and orderby be used together?

995


what is a traditional network library for sql servers? : Sql server database administration

928