Sri Lanka .NET 
       Forum Member

Monday, December 17, 2007

Give me a break

 

I got this nice/funny/interesting mail from one of my best friends Ramesh!

Thought of share this interesting mail with others.

 

MY Dear ON-LINE FRIENDS,

I want to thank all my friends and other unknown people who have forwarded chain letters to me in 2003, 2004, 2005, 2006, 2007 & YOU because of your kindness.

I stopped drinking Coca-Cola after I found out that it's good only for removing toilet stains.

I stopped going to the movies for fear of sitting on a needle infected with AIDS.

I stopped using my ATM card because I am afraid that someone might have installed a small device on the ATM machine that will stole my ATM card number and my pin number when typing it.

I smell like a wet dog since I stopped using deodorants because they cause cancer.

I don't leave my car in the parking lot or any other place and sometimes I even have to walk about 7 blocks for fear that someone will drug me with a perfume sample and try to rob me.

I also stopped answering the phone for fear that they may ask me to dial a stupid number and then I get a phone bill from hell with calls to Uganda, Singapore and Tokyo.

I also stopped drinking anything out of a can for fear that I will get sick from the rat faeces and urine.

When I go to parties, I don't look at any girl, no matter how hot she is, for fear that she will take me to a hotel, drug me, then take my kidneys and leave me taking a nap in a bathtub full of ice.

I also donated all my savings to the Amy Bruce account. A sick girl that was about to die in the hospital about 7,000 times. (Poor girl! she's been 7 since 1993...)

I went bankrupt from bounced checks that I made, expecting the $15,000 that Microsoft and AOL were supposed to send me (when I participated in their special-mail program) would arrive soon.

My free Nokia phone never arrived and neither did the free passes for a paid vacation to Disneyland.

Still open to help someone from Bulgaria who wants to use my account to transfer his uncle's property of some hundred millions $.

Made some Hundred wishes before forwarding those Dalai Lama, most of those "Wishes" are already married (to someone else)

IMPORTANT NOTE: If you do not send this e-mail to at least 913760 people in the next 10 seconds, a bird will sh*t on your head today at 04.00 p.m.

Now give me a break !!!

MSSQL Select Top 10 and Next 10 (fwd ...n)

The following query will emulate a

SELECT emp_id,lname,fname FROM employee LIMIT 20,10

That says, give me 10 records starting at record 21. So what will be
returned are rows 21-30. This is used heavily in web-based apps so you can
do recordset paging.

Here is what you can do in MS SQL to emulate it (this runs on the PUBS
db):

select * from (
select top 10 emp_id,lname,fname from (
select top 30 emp_id,lname,fname
from employee
order by lname asc
) as newtbl order by lname desc
) as newtbl2 order by lname asc

The main thing to remember is to deal with all your ORDER BY clauses and
also to use the inner TOP as the sum of what you are looking for. In this
example - 30 since you start at 20 and want 10 rows (20+10=30).

Hope this helps you as it has helped me improve performance greatly on my
web-based apps since I no longer have to transfer loads of data across the
wire to get just the 10 results I display on a page.

Don't even think about using the internal ADO paging stuff if you have a
lot of records to deal with, it will kill your performance as it must pull
the entire recordset down to the local machine before it can do its work.
Why bring down 20,000 records if you only want to display 10?

Wednesday, December 12, 2007

6 Truths of Life.


1.  You cannot touch all your teeth with your tongue.
2.  All idiots, after reading the first truth try it.
3.  The first truth is a lie.
4.  You're smiling now because you're an idiot.
5.  You soon will forward this to another idiot.
6.  There's still a stupid smile on your face.