Q:

Get every 30 mins interval of 24 hrs in sql

May I ask if you guys have an idea on how to achieve the table below in ms sql:
Time interval is every 30 mins depends on the date range that will be given as parameter.
Ex. Date Range = 02/02/2015 - 02/03/2015

A:

You could create a numbers table then use that to generate the 30 minute intervals to be added to the start date.
declare @fromDate datetime; set @fromDate = '2015-02-02'
declare @toDate datetime; set @toDate = '2015-02-03'

; with cteNumbers as (
    select
        row_number() over (order by o1.object_id, o2.object_id) - 1 as rn
    from
        sys.objects o1
            cross join sys.objects o2
)
select
    dateadd(minute, rn * 30, @fromDate) as DateTimeInterval
from
    cteNumbers
where 
    dateadd(minute, rn * 30, @fromDate) between @fromDate and @toDate
order by 
    DateTimeInterval

