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 the latest version of microsoft sql server?

1051


Do you know what is difference between stored procedure and user defined function?

1099


What is de-normalization and what are some of the examples of it?

976


Explain activity monitors

1082


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

1008


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

1016


How do I partition a table in sql server?

1048


Why use sub query in sql server and list out types of sub queries?

1000


What are the differences between substr and charindex in sql server.

1123


Please explain that what are the basic functions for master, msdb, model, tempdb and resource databases? : SQL Server Architecture

982


Which database stores information about replication?

1073


Where is localdb stored?

946


How many replicas are maintained for each sql azure db?

124


Can you explain the disadvantages/limitation of the cursor?

992


What is primary key and example?

963