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

Answers were Sorted based on User's Feedback



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

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

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

Answer / 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

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

Answer / muhammadrashidmughal

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

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

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

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

Answer / sandeep rana

select * from table where columndata not in(select
columndata from table where date between '' and '')

Is This Answer Correct ?    0 Yes 4 No

Post New Answer

More SQL Server Interview Questions

select top 5 * from emp order by newid() my question is , how this query get executed?

5 Answers  


What are the hotfixes and patches in sql server?

0 Answers  


How do I completely remove sql server instance?

0 Answers  


If user is owning any SQL Objects, can we drop that user

0 Answers  


how we can use a database with php.

2 Answers   HCL, IT Solution,


What is coalesce and check constraint in sql server?

0 Answers  


List the different normalization forms?

0 Answers  


How to display n-1 columns from n number of columns, from a single table in MS SQL server 2005?

2 Answers  


What are the Pre Requisites when you apply Srvice Packs?

1 Answers   IBM,


What do you mean by SQL injection attack?

0 Answers   Ittiam Systems,


Why variables called the most powerful component of ssis?

0 Answers  


Where are SQL server users names and passwords are stored in sql server?

0 Answers   HCL,


Categories