which query u can write to sql server doesn't work
inbetween 7.00PM to nextday 9.00AM
Answers were Sorted based on User's Feedback
Answer / 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 |
select * from urTable
Where urDateColumn
Between '2007-10-20 17:00:00 PM'
and '2007-10-21 09:00:00 AM'
| Is This Answer Correct ? | 14 Yes | 17 No |
Answer / vimala
Declare @hour varchar(100)
set @time=convert(varchar,getdate(),114)
set @hour=SUBSTRING(@time,1,2)
if(convert(int,@hour)>8 and convert(int,@hour)<19)
begin
print @time
print @hour
end
| Is This Answer Correct ? | 2 Yes | 5 No |
select * from table where columndata not in(select
columndata from table where date between '' and '')
| Is This Answer Correct ? | 0 Yes | 4 No |
Why transaction is important?
What is indexed view? How to create it?
What do you mean by tablesample?
what's the maximum size of a row? : Sql server database administration
What are the different types of join?
What are system databases into sql server (2005/2008)?
Explain the use of containers in ssis?
Explain what is it unwise to create wide clustered index keys?
what is the maximum size of sql row in mssql?
How to get a list of columns in a view using the "sp_columns" stored procedure?
how to restart sql server in single user mode? How to start sql server in minimal configuration mode? : Sql server database administration
What is precedence constraint?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)