Mar 2nd, 2009 | No Comments

SQL statements can be difficult to diagnose and debug. SQL Server does not include any default way to debug and step through a stored procedure, but Visual Studio does. Using the Server Explorer, you can step through the execution of a stored procedure or function right inside of Visual Studio. The first step is to open the Server Explorer and create a data connection to your database.

You will then see the stored procedures and functions of your database listed in the Server Explorer.

From the Server Explorer, you can right-click on a stored procedure or function and you will see a menu item named Step Into Stored Procedure,

When you select Step Into Stored Procedure, you will see the Run Stored Procedure dialog,

After specifying the values for any parameters the stored procedure has, click the OK button. Visual Studio will now execute the stored procedure and open it in the document window, stopping in the first line of execution.

You can now step through the stored procedure as it executes. You can set breakpoints just as you would in normal code—the only limitation is that you can specify only location and hit count breakpoints.

Because T-SQL is inherently different than .NET languages, the debugging experience is a little bit different. Here are some of the limitations with SQL debugging:

  • You can use only location and hit count breakpoints in T-SQL stored procedures and functions.

  • You cannot use Step Into to step from .NET managed code to T-SQL. You can set breakpoints in the stored procedure though, and the debugger will break when it comes across them.

  • You cannot use Break while a SQL statement is already running.

  • You can’t use the Set Next Statement function as you might in managed code.

Some other differences are the facts that you can’t use the memory or registers windows, as they just don’t apply to SQL. Unfortunately, SQL Print statements are not shown in the output window either.

You cannot run triggers directly, but you can set breakpoints in triggers, and if they are triggered, Visual Studio will break into their execution on those breakpoints.

Feb 21st, 2009 | 1 Comment

There are two type of angry people explosive and implosive;

Explosive is the type of individual you see screaming at the cashier for not taking his coupons. Implosive is the cashier who remains quiet day after day and then finally shoots everyone in the store.

Don’t get mad, don’t get even and learn to calm down. How ever this is difficult to do when your boss asks for a report way before the deadline. Experts tend to believe that anger is merely the symptom of a far deeper problem.

Some people are just chronically angry and in the habit of being angry. Giving in to their demands like offering an alcoholic drink. If you scratch below the surface, there’s a lot of pain and hurt that needs to be addressed.

When an emotion begins to hamper you and your family life, it’s time to seek the help of a counsellor. We should learn from our mistakes and cut down on expectations which set us up for disappointments.

Control anger before it controls you. Instead of slamming the door when you’re angry or throwing knives, learn to approach the problem in a straightforward manner.

Underneath every anger lies fear. Anger is nothing but a defence mechanism. An angry, young man is not charming; what you should aim for is a build-up of contagious energy, where you are contained and in acceptance of everything about yourself, including the emotion of anger.

Tips to manage Anger

- Relax, think of a place or a time that you particularly enjoy.

- Counting from 50 backwards shifts brain activity from the emotional to the analytical part of the brain, decreasing the intensity of the unwanted emotion.

- Laugh often and watch movies that tickle your funny bone.

- Don’t jump to conclusions. Listen to others.

- Instead of revisiting hurtful events in your mind, forgive the person who wronged you.

- Have a healthy diet. Adequate vitamins are vital for your body.

- With children, don’t over stimulate them with school, hobbies and tennis lessons. A child needs time to relax.

Written by Ajay Matharu

February 21st, 2009 at 3:28 pm

Page 22 of 22« First101819202122