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

What is an example of a foreign key?

694


What do you mean by data manipulation language?

764


can a table be moved to different filegroup? : Sql server administration

712


you accidentally delete the msdb database what effect does this have on your existing sql databases, and how do you recover? : Sql server administration

908


To which devices can a backup be created and where should these devices be located? : sql server management studio

729






you notice that the transaction log on one of your databases is over 4gb the size of the data file is 2mb what could cause this situation, and how can you fix it? : Sql server administration

727


How can I check that whether automatic statistic update is enabled or not?

783


What is statement level trigger?

750


What happens if strings are casted into wrong code pages in ms sql server?

824


What is scan table/view and seek table/view when its occurs? : sql server database administration

734


Explain Geography datatype in SQL Server

805


Explain about protocol layer present in SQL server?

783


What is trace flag in sql server?

718


What do you mean by an execution plan? Why is it used?

729


What is the return type of executeupdate ()?

690