Monday, December 12, 2011

How to Archive SQL error Logs

To create a new error log, execute following:

1. Restart the sql server service. It will create a new error log
2. Execute following:
Exec ('DBCC ErrorLog')
3. Execute following:
Exec Sp_Cycle_Errorlog

Tuesday, April 19, 2011

To find what caused a postback

Sometimes there could be multiple controls on UI and it may be difficult to figure out which control caused the postback while debugging.

1. On aspx/ascx page use following:

Request.Form["__EVENTTARGET"]

2. on a class file use following:

this.Page.Request.Form["__EVENTTARGET"]

Saturday, March 5, 2011

Take responsibility

Recently I came across the book named "License to live" written by Priya Kumar.

Though I had never heard of the writer or the book, I just bought the book.

The book is a short novel about someone who is lost in corporate maze. Her situation is similar to all the people who have achieved every professional success at a very short age, who has fulfilled all their dreams and they do not know what next? Those who think that they have all the happiness they have ever craved for in their life and yet they are not happy. It’s about a person who has lost the very purpose of living.

And then she meets someone she thinks who can change her life.
Through that person she is able to view her future, in fact multiple and drastically different versions. Few are really something that she wants to be where she is happy and content with her life and few that does not want to be where she has lost complete control of her life. There she realizes that any of these futures can be hers provided she works towards it.

Then she comes across her Past. The parts of past which she wants to bury because she has not been able to forgive herself for those parts of the past. Though she is very successful at present but the burden of past is not allowing her to enjoy the fruits of hard work. There she realizes that she has to let go of the past so that she can be happy in present.

But the most difficult part comes when she meets her present. Then she finds herself in time trap as she is never living in her present. She can see the reflections of her past and the imagination of her future but not her present. There she accepts the fact that she has to take responsibility. Only if she takes responsibility of her present, she can make her future better and she will not have anything to regret about the past.

While reading the book, though the situation was very hypothetical, I was able to relate to most of the parts of the book. So many times we are so worried about tomorrow that we forget to live today. We forget that today’s conscious effort will make a better tomorrow and a better yesterday.

So Many time we have a simple excuse "I hardly find time to do this" or "I am too busy" but we forget the fact that everyone in the world gets same 24 hours in a day. We compare ourselves with our neighbors/competitors and complain that they have got too many resources which I do not have. But we forget that even we have a number of resources which they do not have.

Life gives equal opportunities to everyone in some way or other and it’s up to us how we make use of those opportunities.

Monday, January 24, 2011

Inspiration

As I have mentioned in my last post I was inspired to learn SQL server in detail after I started following Pinal Dave's Blog.

Similarly few months back I saw my friend was reading something on her PC. The title in big letters appeared very attractive.

I asked her what it that she is reading is.
She said: Robin Sharma’s' Blogs.

"Robin Sharma? Isn’t it that guy who wrote "the monk who sold his ferrari"

"Yeah"

I asked her for the URL.

I found the blogs from Robin Sharma very inspiring.

I browsed through many posts in his blogs and one of them was "60 TIPS FOR A STUNNINGLY GREAT LIFE"

I liked some of the points, laughed at some others.

Yet one point that caught my attention was "Read “As You Think”."

I got curious and immediately clicked on the link. Oh it’s another Self-help Book!!! That was my reaction.

Yet I could not contain my curiosity and searched for a synopsis.

The Synopsis was only few lines but quite inspiring.

"As we think we influence people around us. We have great power within us and we can shape decision of people around us. Decisions made by people which can change course of our lives."

ohh!! Is it!!. Let’s try.

I was going through a lot of job interviews those days and was always scared whether I'll make it or not.

I started thinking in a positive way "This person is going to ask me only the things I know. He will like my knowledge and experience and offer a job"

Every time i would go for an interview I would have only this thought in mind. It worked!!!! In a month I cleared 4 out of 5 job interviews. Amazing!!! Wasn’t it.

But mind is a devil as well. So there are some funny incidences as well. Whenever my lead would come near my desk I would say in mind "Go away". It will happen that the person would forget why he came to my desk and will go back to his desk.

There were multiple instances where I felt that the positive thinking helps.

What you think about yourself, you become that. Hence it’s really important that we control the way we think.

Thursday, January 20, 2011

Chance upon meeting with Pinal Dave

Today was like any other day. After not finding anything interesting in the usual meals of cafeteria, I decided to take a masala dosa. As I was waiting for my turn to get the dosa, I saw a familiar face. "Is he Pinal Dave?"

It was indeed Pinal Dave. First I thought "should I talk to him?". But then thought "He might be having thousands of fans like me. Why should I bother him during his lunch time".

But curiosity took better of me. How can I miss a chance to meet my technical world Idol. How can I let go of an opportunity to at least talk to the person who has inspired me to learn sql server and performance tuning.

I went to him and asked "Aren't you Pinal". He neiher was neither shocked nor impressed. Off course he would be encountering this almost every day. (He is a known personality among SQL server developers. Google any sql related problem and first few results will be from SQLAuthority blogs. )

He said "Yeah I am Pinal".

I introduced myself. But I was completely at loss of words.

Not sure what to say and how to say. I just managed to say this much “I am big fan of yours. I have been inspired a great deal by you.” He said thanks.

Again I asked "How come in Microsoft?"

He said "I came for training."

Then he asked "What are you doing here"

I told him "I work for Infosys and currently working as vendor for MS"

Then he told me that he is going to join Microsoft soon.

By then our dosa was ready. I got mine and he got his.

I was then wondering should I ask him to join us for lunch? or should I let him go his way.

Then he said He needs to find a place to sit. I got this opportunity that probably he doesn't have company and hesitantly asked "Would you mind joining us for lunch.” He accepted.

After settling for lunch and introducing him to my Infosys friends (Asha, Sowmya and Vivek) I started asking him questions one after another. All the questions that ever ran through my thoughts whenever I read his blogs.

And definitely this was my first one: How do you manage to write one blog every day. It’s really difficult to be consistent to write something every day.

He said: Yeah It’s a taxing job to do. Even simplest of the post takes 2-3 hours to write. The post he wrote yesterday took him more than a day. And he mentioned that he would be completing 1600 blogs the tomorrow.

Next question: Does he keeps his topics piled up at once or is it that he gets ideas on the fly?

He said: mostly for next 2-3 days.

Next question: Does he write all of them at once or one each day.
He said: For next 2-3 days.

He told about how he is learning new things like we do everyday by trial and error.
Even he finds his work monotonous sometimes.(Till today I used to think his job is very exciting which gives him opportunity to travel so much and meet so many people and exchange ideas).

He was very humble to say that he is not a native English speaker. (In fact I have been his follower because he writes in a very simple language)
He even showed snap of his 16 month old daughter.

He was really happy to share the info that his previous days' blog hit-count is 42,000. I was shocked. 42,000 hit count for a one blog in a day!!!!!!!!!!. That’s’ amazing.
I had asked him earlier that I want to have a photo with him. But later I forgot. Somehow after lunch he managed to find me and reminded me of the photo.
During the whole lunch I did not feel for once that that I have met him for the first time. The whole conversation went like meeting a very close and old friend after a long time and catching up.
Overall a memorable experience and I am very much thrilled.