which query u can write to sql server doesn't work
inbetween 7.00PM to nextday 9.00AM

Answer Posted / sumesh

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 ?    11 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain about analysis services?

661


What is compression - row-level and page-level compression?

607


Explain index in sql server?

671


What is model database? : SQL Server Architecture

662


How do you troubleshoot errors in a SQL Server Agent Job?

645






What do you mean by an execution plan?

670


How do we upgrade from SQL Server 6.5 to 7.0 and 7.0 to 2000?

1720


In which tcp/ip port does sql server run? Can it be changed?

640


how to trace the traffic hitting a sql server? : Sql server database administration

1273


What is difference between index seek vs. Index scan?

712


What is proper subset of candidate key?

676


what's sql server? : Sql server database administration

579


What is field in algebra?

717


Can you explain how long are locks retained within the repeatable_read and serializable isolation levels, during a read operation with row-level locking?

629


Mention what are the core components of ssrs?

233