Monthly Archives: September 2011

A Clever way to troubleshoot StoreProcedure in Visual Studio

If you have a complex SQL storeProcedure that you want to troubleshoot, the chances are you want to find out what values are being passed to the storeprocedure in the first. In a running application, it is hard to find out. On easy way is this which will solve a lot of your problems and possibly headache.

create procedure usp_GetCustomer
param @customer_id int

begin
select customer_name, customer_address from customer_tbl where customer_id = @customer_id

end

Now lets say you are using this storeprocedure in your gridview and you are getting no result, i.e, the gridview does not populate. An easy way to see what is going on is modify the query to this

select  @customer_id as customer_name, customer_address from customer_tbl where customer_id = @customer_id

Now the first field name “customer_name” will spit out the parameter that was passed  to the stored procedure. This way you will know exactly what is going wrong in your stored procedure.  I hope it helps.

Thanks!

Are ghost real?

I heard a lot of stories about ghost. Many of these stores were actually not about ghost themseleve, they it is believed around the world, for example soul left by a body when he dies expectedly but about other creature who really co exist with us and who are made of fire. These stories mostly had fear factor in it. For example a woman standing in a field was getting taller and taller and there was blood in street probably because these creatures fight at night with each other. These store existed pre 1970 and earlier. Now they have almost died but there are a bunch of them still around. I still hear of stories of strange sounds out in the country side at midnight. I believe most of them are not true and many of them have been abandoned altogether. How the question begs, are ghost are for real. In this article I will discuss ghost from the aspect that these are souls of dead bodies which could not pass over. Now by science, the topic is obviously very shallow in depth. They do not exist because we cannot to experience them using a scientific experiment. + even we can count on one or two such experience we do not have any knowledge to back it. That is the knowledge to explain something that exist but we can not see, one person can see but the other don’t, appears mostly in night or in dark and has no consistency in it. While I am firm believer in Science, I also believe that number of vidoes out there and investigators who do ghost hunting can not be fake. Yes many people just believe they are fake. But I would say some videos have considerable proof of paranormal activity. They are not only visual, physical but there is also EVP (electronic Voice Phenomena). A skeptic will quickly discard all of these proof and perhaps myself include, however, the proof in these videos is hard to deny as well. Here are some video that are convincing that ghost do exist.

The following clips show top 10 moments of Ghost Adventure. Notice at 6:00, the light in the room turns ON/OFF by itself. This is pretty interesting.
Ghost
Another Video

 

Convert CSV file to SQL Update

convert csv to sql is a tool that lets you convert a CSV file and generate equivalent SQL

Example:

/* Student Table */

student_id    First_Name   Last_name          Fav_sports
1                     Aralia          elata                    Basketball
2                   Cornus         alternifolia       BasketBall
3                  Davidia         involucrata     Football

/* CSV File – We want to update Fav_sports based on student_id */

student_id, Fav_sports
1,VolleyBall
2,VolleyBall
3,Soccer

 

/* Ouput for update stetement */

UPDATE Student_tbl SET Fav_sports = ‘VolleyBall’ WHERE student_id = ‘1’;
UPDATE Student_tbl SET Fav_sports = ‘VolleyBall’ WHERE student_id = ‘2’;
UPDATE Student_tbl SET Fav_sports = ‘Soccer’ WHERE student_id = ‘3’;