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 are the new features of sql server 2008 r2 reporting service?

193


what is blocking? : Sql server database administration

983


Ways to improve the performance of a SQL Azure Database?

123


Can you explain the disadvantages/limitation of the cursor?

910


What is a benefit of using an after insert trigger over using a before insert trigger?

931


How to manipulate data from one table to another table ?

913


How would you choose between a clustered and a non-clustered index?

919


What part does database design plays a role in performance of an sql server-based application?

928


What is an identity column in insert statements?

970


Define msdb database?

974


What is executereader?

898


What is best institute to Learn DotNET And SQL in chennai?

2115


What is the Disadvantage of indexed sequential file.

1029


What are the basic functions for master, msdb, model, tempdb and resource databases? : SQL Server Architecture

951


How does the report manager work in SSRS?

142