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

Can you explain different types of joins?

984


Is BCNF better than 2NF & 3NF? Why?

1102


What are commonly used odbc functions in php?

1056


Which are the important points to note when multilanguage data is stored in a table?

1064


What do you understand by intent locks?

1058


What is the current pricing model of SQL Azure?

104


What is entity data services?

1109


What are the joins in sql server? : sql server database administration

1050


What is the openxml statement in sql server?

1118


Can you explain what is the use of custom fields in report?

1099


What are different types of schemas?

990


What are the hotfixes and patches in sql server?

1062


how many no of arguments can be passed in procedures and functions

5640


Explain what is cte (common table expression)?

1183


What does it mean to invest in the index?

1019