Search This Blog

Friday, December 6, 2013

Exuberant India - Visit Mussoorie (Fun Retreat in a Hillstation Close to Delhi)

Mussoorie, Queen of the Hills, located some 290 km north of New Delhi, is among the most popular hill stations of the country. At 6500 feet elevation, it has some of the most spectacular views of Himalayas. Some of the landmarks of this popular hillstation are the old graceful houses – Captain Young’s Mullingar Mansion, the oldest existing building in Mussoorie, Houses of Irish pioneers – Tipperary, Killarney, Shemrock cottage and the Tara hall, the houses of Scot pioneers – Scottsburn, Wolfsburn and of course the houses of the English rulers – Connaught Castle, Grey castle, Hampton court and Castle hill. There evidently were a lot of fans of the legendary writer Sir Walter Scott as we find old estates of the name of Kenilworth, Rockeby, Waverly and also Abootsford – the name of Sir Scott’s own house in England.


Mussoorie has lot to offer and fun retreat for a quick getaway from Delhi.





How to get there:


travel-plane


Air: The nearest airport is Jolly Grant at Dehradun (61 km). However, Delhi is the most convenient airport.


travel-rail


Rail: The nearest railhead is Dehradun 35 km, connected by rail with major cities and towns of India. Taxis and buses are available outside the railway station for transit to Mussoorie, there is a Mussoorie bus stand near the station.


travel-icon


Road: < 300 KM from Delhi. You can drive, take a bus or private cab to get there.


Where to Stay:


Here is a list of some of the good hotels in the area


Jaypee Residency Manor*****dlx,

Barlowganj,

Tel: 0135 2631800,

Fax: 2631022,

E-mail: reservations.jrm@jaypeehotels.com


Savoy Hotel (Heritage),

The Mall,

Tel: 0135 2632010/120,

Fax: 2632001,

E-mail: savoyhotelmussoorie@yahoo.com

(Rs. 1500-5000/-)


Country Inn Mussoorie***,

Nalapani House,

Hayacoolie Estate, Kincraig,

Telefax: 2631190/4,

E-mail: info@countryinn.co.in


Hotel Green Castle***,

The Mall,

Tel: 0135 2630987,

Telefax: 2632657,

E-mail: greencastle@vsnl.com


Hotel Solitaire Plaza***,

Kincraig Road,

Tel: 0135 2632164/5,

Fax: 2632147


What to do:


Sightseeing:



Cloud’s End

The resort is surrounded by thick deodar forests. The bungalow built in 1838 by a British major and one of the first four buildings of Mussoorie, has now been converted into a hotel.




Camel’s Back Road

A lovely promenade along the wooded slopes.


Children’s Lodge 

A vantage point of Mussoorie, with extensive views of the northern hill ranges.




Gun Hill 

The second highest point in the town, it offers a panoramic view of the surroundings and the snow covered mountains in the north.


You can find more information at the state site: http://uttarakhandtourism.gov.in/sections/mount_places/ZjY0ZjZhhnE1NHNkZg==/ZjY0ZjZoc2RmYTU=




Exuberant India - Visit Mussoorie (Fun Retreat in a Hillstation Close to Delhi)

Monday, December 2, 2013

Rebuild all index in a database

Several times my colleagues asked me about rebuilding all indices in a database. While there are several solution available, I like to use the one below. Please note that sp_MSforeachtable is undocumented but internal so we can expect a much better performance than our own cursor.


None the less, this has helped me alot, I hope it helps you too!!


 


USE <DBName>

GO

EXEC sp_MSforeachtable @command1=”print ‘?’ DBCC DBREINDEX (‘?’, ‘ ‘, 80)”

GO

EXEC sp_updatestats

GO



Rebuild all index in a database

Friday, November 29, 2013

Finding the Nth highest value in a table

I recently was asked by a colleague about finding the  Nth highest value in a table. For example if there is an employee table then finding the 10th highest salary or something similar.


I thought about it and created a query below which obviously is not showing anyone’s salary :) but shows how we can implement it.


Enjoy! and please comment.


declare @nth smallint


set @nth = 4


if (@nth <= 0)

begin

– default to 1 if inappropriate value is provided

set @nth = 1

end


set nocount on;


declare @t table (Id int identity(1, 1), Value decimal(18, 3))

insert into @t (Value) values (1234.56)

insert into @t (Value) values (5678.90)

insert into @t (Value) values (2345.67)

insert into @t (Value) values (3456.78)

insert into @t (Value) values (6789.10)

insert into @t (Value) values (7890.12)

insert into @t (Value) values (8912.34)

insert into @t (Value) values (4567.89)


select [Value] = max([t1].[Value])

from @t [t1]

left join (select top (@nth – 1) [Value]

from @t

order by value desc) [t2] on [t2].[Value] = [t1].[Value]

where [t2].[Value] is null


select [OrderId] = ROW_NUMBER() over (order by value desc)

, [Value] = value

from @t


set nocount off



Finding the Nth highest value in a table

Friday, November 8, 2013

Experience with MS SQL Server

After years of experience with SQL server, I have gathered some of the practices that are good for writing SQL queries, procedures and functions.

Here is my work as presentation, enjoy!!

Monday, October 7, 2013

Devil's Circuit

On 6th October 2013, Delhi region saw and experienced Devil’s Circuit, India’s First Obstacle Run Non Competitive Series. People looking for some adventure and fun, wanted to spend their Sunday in a different way soaked themselves up in mud, freezing water, climbed ropes and walls.. yesterday was for them!!! The day saw participants from various walks of life, students, young professionals, foreign nationals, families…just about everyone!!! The spirit of the participants was amazing!! After the race all the participants who completed the race got a beer(for refreshing yourself :) ), Devil’s T-Shirt and an energy drink and of course a medal upon completion. Live music playing throughout the circuit kept the crowd and participants cheered up!!


You could google for pictures of the event and get prepared for the next Devil’s Circuit. For those of you who missed participating in this one, there’s another one scheduled in March 2014 in NCR, followed by next one in Pune, then Hyderabad and finally in Bangalore!!!


Go ahead and have some fun….



Devil's Circuit

Wednesday, October 2, 2013

SQL Server Fun - Averages with Rollup

Here is tsql way of getting averages and also rolling up. Below example is using adventureworks database that is available with SQL server. It is getting average pay rate by each department and also overall by the company.


use [AdventureWorks]

select[Department] = case when grouping(d.GroupName) = 1 then ‘Company Average’

                              else d.GroupName end,

            [Average Pay Rate] = avg(p.Rate)

from (select [EmployeeID], [Rate] = max([Rate])

            from [HumanResources].[EmployeePayHistory]

            group by [EmployeeID]) p

      inner join [HumanResources].[EmployeeDepartmentHistory] h

                  on h.[EmployeeID] = p.[EmployeeID] and h.[EndDate] is null

      inner join [HumanResources].[Department] d on d.[DepartmentID] = h.[DepartmentID]

group by d.[GroupName]

with rollup

order by 1


SQL Server Fun - Averages with Rollup