It seems the will work only in your system as the following part will not run in every culture.
SELECT @ti = CONVERT(CHAR(2), DATEPART(hour, GETDATE())) + ':' + CONVERT(CHAR(2), DATEPART(mi, GETDATE()))
+ ':' + CONVERT(CHAR(2), DATEPART(S, GETDATE()))
You know different culture has different date time settings. Preparing time/date by concatenation will give you wrong result in different culture. Anyway use the following code
DECLARE @ti TIME(7)
DECLARE @intime TIME(7),
@outime TIME(7)
SET @intime = '10:10:00'
SET @outime = '15:30:20'
SET @ti=CONVERT(VARCHAR(8),GETDATE(),108)
IF @ti BETWEEN @intime AND @outime
BEGIN
SELECT @ti
END
Hope it will work for you.