July 9, 2011

Story of a Famous Person & Software Engineer

A famous business person was died in the year 2003. In his entire life, he and his fellow always used to do some innovative things by updating themselves. They never thought about surroundings and continued to update their latest products. Therefore, after his death, their follower decided to bury him with the newest designed coffin box. Hence, the follower started to search for the same in market. They continued to search but did not find any new one till 2005. At last, they found a shop where a hard working old man was making new designed coffins using his tools.

They told the complete story to the old man and ordered for the most latest designed coffin to bury the famous person. For this, they paid a very good advance amount to the carpenter. The carpenter agreed and asked them to collect it after three years. Firstly, they argued but since it was a matter of prestige, so they agreed to come after three years to collect it.

In 2008, they came to the old carpenter and asked for the newly designed coffin. The carpenter said “Sir, in the last three years many tools have been changed and many new things have been updated, so the design that I have made, is no longer new for the moment. Therefore, I request to provide me some more time to redesign it using newly materials and tools.” This time old carpenter requested for two more years. The executives angered but since already years have been passed and it became more crucial in terms of prestige, so they decided to come again after two years.

In the year 2010, they once again came to the carpenter and angrily asked for the coffin. The old man remains silent. On lots of questioning, he replied in low voice that it is not yet ready. The executives asked the reason: why? He replied the same answer that due to updating of materials& tools in market; it is no longer of new design. The executive asked for the final completion date. Carpenter said “Sorry! I cannot give you the exact time,because every year a new material and tools are launching in market with some new features.” Executive said in loud voice “What nonsense! Do you know who we are and who the person was, for whom we are searching it?” The carpenter replied: “Yes, I know.” They shocked after listening his answer. You know who was that famous person? He was Microsoft. And the old carpenter was a software engineer who was using .net tool to design the coffin.

January 20, 2011

Nine Promises Should be taken before choosing software field

1) I have already enjoyed my life in childhood

2) I love tension

3) I don't want to spend time wid my friends

4) I love night duties

5) I love to work on Sundays and holidays

6) I want to take revenge on myself

7) I don't want to get married b4 30 yrs of age

8) I want to study until my death

AND FINALLY

9) I don't want hair on my head

January 18, 2011

SQL Server 2005: ISNULL() function

In MS SQL Server, when a string is concatenated with other string variable whose values is NULL, the result will give NULL. Use ISNULL() function to solve this type of problem.


In MS SQL Server, when a string is concatenated with other string variable whose values is NULL, the result is NULL. Consider two strings s1=’Hello’ & s2=NULL. The resultant string s3, where s3 = s1 + s2, will give NULL. Means, whenever you will try to concatenate two columns where either column has value NULL, the result column will show NULL.
I searched lots & the better result I found after some RnD is to use the function ‘ISNULL()’. In the given below example, I have taken three string variables @s1, @s2 & @s3. Variable @s1 initialized with ‘Hello’ while @s2 initialized with NULL. After concatenation @s1 & @s2 assigned to @s3 and you can see the result displayed is NULL.
declare @s1 varchar(10), @s2 varchar(10), @s3 varchar(20)
set @s1 = ('Hello')
set @s2 = (NULL)
set @s3 = (@s1 +' '+ @s2)
print (@s3)

To solve this problem, you can use either ISNULL () or COALESCE() function. So, to concatenate a string value with null value to get exact result, we can modify our above example as:

declare @s1 varchar(10), @s2 varchar(10), @s3 varchar(20)
set @s1 = ('Hello')
set @s2 = (NULL)
set @s3 = (@s1 +' '+ ISNULL(@s2, ''))
print (@s3)

This will return actual result even when you will concatenate a string with null value. The function ‘ISNULL()’ takes two arguments, Ist column name/variable which contains NULL value and other argument is the value that you want to replace with. Any character/string you can use to manipulate it according to your choice.

Your comments/suggestion will be highly appreciated.