Subhro, you probably have not used my edited code.. please run my code in my prevoius post (i have updated it) and check with your dsired result! THe first image u have attached (your expected output) exactly matches with my new code..
I am posting the code again for your convenience
declare @table table
(empid int, cnt2007 int, cnt2008 int, cnt2009 int)
insert into @table
select 1, 1, 1, 1
union all
select 2, 1, 2 ,1
union all
select 3, 2, 0, 2
select empid, cast((replace([Year], 'cnt','')) as int) as orderyear , value as numorders From
( select * from @table ) UNPIVOT_TABLE
unpivot
(value for [Year] in (cnt2007,cnt2008,cnt2009)) UNPIVOT_handle
where value <> 0
Check it out and tel me if thats right..
Cheers!