Retrun row numbers from a TSQL query

I came across a situation where I need to get the row numbers together with the result set. And finally found a very tricky way of doing it which I felt worth sharing;

SELECT col1,col2,(SELECT COUNT(*) FROM Table1 T2
WHERE T2.pkid <= T.pkid) AS rownumber
FROM Table1 T

And if you have a where condition it will return the original row number regardless of the no of the filtered rows. Hope this will be helpful to someone.

Second life : The revaluation of modern web

If you have ever heard of Second life ( you must know how exciting it is. When I came across this for the first time I felt like it will be the next generation of web. It has given a birth to the most lacking part of the web (virtual representation of the community).
For those who don’t know what it is this is how SL defines itself:
"Second Life® is a 3-D virtual world created by its Residents. Since opening to the public in 2003, it has grown explosively and today is inhabited by millions of Residents from around the globe. "
When you get registered there you can create an avatar which is basically virtual you. And you can build your own house according to your own design. You can buy stuff using Linden Dollars (SL currency) or start your own business. Also there are lots of events everyday you can participate from community service events to fashion shows. The most important thing is each and every person you meet there is actually a real person. And also for the people who do code can use Linden Script Language (LSL) to code a small game or a highly complex program. If you build something interesting you will have a good consumer market so you can earn money. And also you can exchange your Linden Dollars to USD at any stock exchange inside the SL.
This site has initialized in 2003 and now it has more than 1 million residences, so if you go there you can meet lots of people and if you are smart enough you can be rich or famous in the second life. There is a real chance that you may feel the second life is better than your first life. At the moment there are people who has addicted to this and spent most of their time in this virtual world and live less time in the real world.

JR the Savior for Sri Lankan Politicians

There are lots of controversies regarding yesterday’s mass strike planned by opposition parties. But as a whole it was a failure even though Mr. Lal Kantha says it was a trial run. And once again Mahinda Rajapaksha government was able to come out of the trouble.
As far as I think people had 1980 July incident in back of their mind and that’s what made this a failure. So it’s another instance where JR's tactic has paid out for this generation of politicians. We have heard lots of people(even presidential candidates) blaming for Executive presidency as well but all these time each and every President has benefited from that. So the things he did still count well being for today’s politicians. He has done his part in the history for the politicians to survive for another decade or two. Also he has ruined our chances to develop as a country by making stupid decisions which we haven’t reverse even after more than 30 years. And we have no hope those will happen in the future as well. All together we are a hopeless nation with bunch of selfish politicians.

Cartoon by Dasa for Lankadeepa says it all

Ajantha Mendis : Rising of a Legend

I was so fascinated to watch Medis in action yesterday against India. It was a while since we saw Sri Lankan Cricket team doing this well in a competition. Followed by Jayasooriya's brilliant innings in the upfront it was all Mendis show. Following are the few interesting comments I found :
"It was like you were playing something else, and the ball was something else. I won't really blame the batsman, we couldn't pick the deliveries. If you see our bowling, it was the best bowling line-up we could offer when we wanted one more extra batsman in the side. They tried their best and we could have got 274 but for the Mendis factor." - MS. Dhoni
"I wonder how good he was as a kid at carrom. Take the "red" boy!" - Crickinfo Live Scorer on Mendis
"We had never played him before. We had only seen videos and you can visualise and all, but he was difficult to pick out there in the middle. We never had any real reply against him." - MS Again
"A mystery spinner he has been thus far. The mystery is now out in the open and every batsman is out to solve it. The real challenge for Mendis, of uncertain categorization, to maintain that secrecy, begins now. " -Osman Samiuddin
"Dhoni, whose innings stood out for its sensible approach, was mesmerised even at the press-conference. For every question demanding explanations for the defeat, he the same answer: Mendis." - Sidharth Monga
'The 23-year-old plays his cricket for the Sri Lankan army. I suggest he's going to make a right officers' mess of hundreds of international batsmen's stumps in years to come" - Sportingo's Mark Rivlin

Dialog TV is on a role to suicide

I am highly disappointed with DTV's channel selection. When the Zone Reality went off they have introduced a real crap channel called NDTV Good Times which is giving a very bad time. In contrast to the Zone Reality which is one of the very few quality English channels in DTV this is really heart breaking. Given the fact that there a hell of lot of Hindi crappy channel's and adding more to it when dropping quality ones, where are they really going towards. In my opinion they are going to fell in to earth.
Blog Directory -