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
What is the difference between commit and rollback?
Does index speed up select statements?
Explain how to maintain a fill factor in existing indexes?
What is trace flag in sql server?
What are distributed partitioned views?
Define compound operators?
Write the queries for commands like Create Table, Delete table, Drop Table etc.
what is the difference between writing data to mirrored drives versus raid5 drives. : Sql server administration
What is data modeling and Reterminal integrity?
How many types of built in functions are there in sql server 2012?
While migrating Microsoft SQL Server 2008 database to SQL Azure, what can be done to ensure the database connectivity does not degrade?
New concepts of sql server 2005 use in your project.
Distinguish between commit and rollback?
What are types of storage modes? : sql server analysis services, ssas
what is a self join? : Sql server database administration