Thursday 13 October 2016

Configure Database mail by using T-SQL Script.

To get notification or alert from the DB Instance, Database mail is the feature that will help here.  Database mail will send notifications when any alerts occurs or when jobs fails/success depends on configuration. 

In below article I will show, how to configure Database mail using T-SQL scripts.

--First of all it’ll need to enable the Database mail on Instance:

sp_configure 'show advanced options', 1;  

GO
Reconfigure;  
GO  
sp_configure 'Database Mail XPs', 1;  

GO
Reconfigure  
GO  

--Create Profile for the database mail: 

Execute msdb.dbo.sysmail_add_profile_sp
       @profile_name = 'ProfileName',
       @description = 'Profile to send Automated mail notification'
GO

--Create mail account for the Database mail:

Execute msdb.dbo.sysmail_add_account_sp
@account_name = 'AccountName',
@description = 'Account for sending Automated DBA Notifications',
@email_address = 'youremail@domain.com',
@mailserver_name = 'smtp.domain.com'
GO

--Add account to the profile:

Execute msdb.dbo.sysmail_add_profileaccount_sp
    @profile_name = 'ProfileName',
    @account_name = 'AccountName',
    @sequence_number = 1
GO
--To make profile public, default
Execute msdb.dbo.sysmail_add_principalprofile_sp
@principal_name='Guest',
@profile_name='ProfileName'
@is_default=1
GO

--Sending a Test Mail to verify the mail configuration

Execute msdb.dbo.sp_send_dbmail
@profile_name = 'ProfileName',
@recipients = 'EmailId@domain.com',
@body = 'This is Database test Mail.',
@subject = 'Database Email Testing'


Note : Here I have used AccountName , ProfileName & dummy domain for Example. Please use your own domain and SMTP address, your choice of AccountName & ProfileName.

Saturday 9 April 2016

How I reduced 24 Kgs in 6 months


The first and most important thing required for your weight loss program is not your diet or exercise, but it is your DEDICATION. So, if you are a kind of person who makes a new year plan and never makes it a complete success at the end of the year, loosing weight quickly and efficiently is not your cup of tea. Quickly means a minimum of 3 months. If you are not amongst dedicated people you need not read the below.

IMPORTANT NOTE : Every one has a different body, so the plan which worked for me may not work for you in the same way. Following the same plan, you may reduce more weight in same time period or might not reduce the weight at all. My weight loss plan was supervised by a professional nutritionist. So at any point of time, if you feel you are not on the right track, you may leave the plan or take guidance from a nutritionist or a doctor. Please consider this article strictly as informative one and use it at your own discretion.


3 Equations of  my body :

  • Diet plan and Exercise = Weight Loss
  • Either Diet plan or Exercise = Stable weight
  • Neither Diet plan nor exercise = Weight Gain
It mainly depends on how you spend your entire day and what you eat in your plate. A software professional may take more time to loose the same weight than a shopkeeper, where as a bus conductor may not loose or gain weight in any of above cases as he is active for the whole day.  A bus conductor keeps on moving or is standing all the time, so his body is much more active than a software engineer, who spends 8-9 hours of a day sitting idle on chair with only fingers moving. You need to give a try to see what suits best to your body - Diet, Exercise, Both, or None.
You may feel jealous about some people that even if they eat so much more than you, they sleep a lot more than you, they don't work out any time, still they are slim and fit, whereas if you eat even a chocolate, you start putting on weight. Don't worry, its not your fault. its all how your body metabolism works. You though might have other benefits such as your stamina and immune system is way lot stronger than those lucky people who do not put on the weight easily. And if you gain weight easily, you can loose it easily too, but its much harder for those other people, who don't gain weight easily, once they have gained weight somehow. So learn to make full and better use of your body metabolism. 


Basal metabolic rate (BMR) : 

On an average a 5'9" tall 27 year male needs around 1800 calories as BMR. Which means you need 1800 calories to stay alive, survive and keep your body moving. For females, it is around 1600 calories a day. You can check your BMR online at 


You should NEVER have calories intake lesser than your BMR, failing to do so may cause dizziness, eyes blackout etc. and is actually not at all beneficial for weight loss. The body tends to loose lesser weight in such cases so as to cope up with the energy lost.

When you burn lesser calories than what you eat, you gain weight
When you burn equal calories as to what you eat, your weight remains stable
When you burn more calories than what you eat, you loose weight.


What to eat and what not to : 

At any time, not eating food or skipping a breakfast or a meal is not helpful for loosing weight. In fact such things ask your body to reduce their metabolism and hence your body tends to use the food in your stomach for more time than normal. Its not "how much you eat, but it is what you eat."- A nice line said by one of my office colleague. If you eat correct type of food, you still fill up your stomach and gain lesser calories. Fast food such as burger, french fries, sandwiches etc aren't suitable for proper dieting because they are full of calories and take lesser space in your stomach, so you soon will be hungry after having these kind of foods. Whereas if you have high protien food such as soyabean, sprouts, green vegetables, salad etc, your stomach gets full faster and yet you eat only 25% of calories of what you ate in a burger. Detailed information about what food to eat and what not to is written below.

Do not eat : Rice, potatoes, Sweets, Bakery products such as paav, samosa, puffs, cakes, pastry, milk by products such as ghee, paneer, cheese. Any food which is processed should not be eaten. The fact behind this is, to break down those complex processed food, body takes too much of time and hence most times such food is not even broken down into simpler digestive elements. Fruits such as banana, guava, chikku, mango shall be avoided. Oily foods shall also be avoided. Green chilly too. Cold drinks, cold coffee, tea, milk shakes, chocholates, maggi, sweets shall be avoided.

What to eat : Simple foods such as All green leafy vegetables, salads such as carrots, radish, beetroot, lemon; soyabean, sprouts, chapatis. oats. Fruits such as pineapple, apple, watermelon, muskmelon, black grapes (in limited quantity), coffee (ofcourse without the chocholate) is OK to have, but shall be taken daily once at most only when needed. Pineapple is one of the fruits which is full of antioxidants and helps loose weight. Garlic is good for reducing bad cholesterol from your blood. (Yes, there is also something called good cholesterol). Prefer liquid foods such as dal, soups, thin gravy curries which are easier to digest.

You can have any number of Apples. They are good to eat whenever you feel hungry during your diet plan.

The Non-veg part : I am a vegetarian, except that I eat the cakes which have Egg. But anyhow Cake comes under "Bakery product" or "Sweets" category so I was not having it unless my weight was stabilised - (until 4 months from start of my plan).
I would recommend not to have any of the non - veg items. Yes, they are high in proteins, but at the same time they are also high in fats. If at all you feel like eating non-veg, have only egg whites or fish NOT more than once a week. Say NO to chicken, mutton and all other non veg items. Fish and egg whites are rich source of protein.

For the first 2 weeks you will get a strong feeling to stop the plan and start eating the food as you were before. But after 2 weeks it is much easier to keep control on your mind. Either have full control on your mind or have company of people who are diet conscious. This helps a lot to control yourself. Today I dont even feel like having rice, extra chapati or sweet in my plate. Once you are used to it, its even easier.
Believe me, its the hardest part to keep control on your mind when everyone around you is eating cakes, candies, ice creams and you have green vegetables and salad in your plate :( and that too in a limited quantity. Almost 90 % of people loose control over this and tend to stop the plan OR start the plan "from tomorrow". Only those who have complete dedication, succeed.

Some useful links and videos for you to understand what is good food when you are on diet plan

What is 200 calories : http://www.wisegeek.com/what-does-200-calories-look-like.htm
What is 200 calories : https://www.youtube.com/watch?v=KMGUmcveQeg





Time Frames : 

 Before starting my weight loss plan, my BMR was 2191 calories per day and  I was consuming around 2500 calories per day with no or very less exercise (the BMR increases with weight and height because to move those extra pounds on you, body needs more energy). This counts to 300 extra calories per day. I started my weight loss plan on 5th Oct 2015. Within 15 days I lost 6 Kgs of weight. It sounds crazy (I myself did not believed it), but it was the result of both Diet + Strong exercise. But it was neither noticeable on my face nor my belly was reduced by an inch. It is actually not good because loosing weight fast will also make weight gain faster later, if either exercise or diet is stopped.





You might have noticed that I had reached my target in the 4th month itself, but that wasn't a good time to stop the diet and exercise as my body was used to it. The trick is that you loose more weight than the target and then gain the extra lost weight so that your body tries to stabilize the weight. Be sure to make the measurements of your belly, thighs, arms and chest (even face) so that later, upon completion of the course you may check the same and find it reduced. Its a great confidence to see the measurements reduced and it works as a boost to your plan. You should keep checking the weight on scale 2 times a week and modify your exercise and diet as per the results. Make sure everytime you measure the weight, you measure it at the same time of day like say 11 AM.


Exercise : 



Morning is the best time to do the exercise. After you wake up, your body needs to regularize blood pressure which takes about 15 mins after stretching your body and its a natural phenomenon. It increases blood flow to your muscles. Start the exercise by short ones first. I start it with the 

        One round takes about 9 minutes in classic mode. Remember that Classic mode only has to be performed. You need to cut down your fats first. Then you may start with the ABS workout so as to build the Abs. I used to do 2-3 rounds of it which counted to about 30 mins at the initial phase of my plan

2) 3 mins massive fat burning https://www.youtube.com/watch?v=lyxCEbNAVpQ

        This has to be done after the 7 mins workout. Its kind of intense workout with beginner steps in a smaller window. Do the beginner steps for the 1st week or so and when you master the steps go ahead with the actual exercises. I used to do 2 rounds of this which counted to about 7 minutes.
Resulting in 40 mins of exercise daily. Once I reached my target in the sixth month, to stabilize my weight I reduced the exercise to 1 round each, 15 mins per day. Both these exercises can be done at home without requirement of any machines or GYM. Gym workout is basically for building muscles and not for reducing weight. You may start the gym exercise after your target is achieved. 15 mins exercise everyday along with proper diet, to stay fit, is indeed a good deal.

Tips for a good workout :


  1. Never close your eyes at any point of time during the exercise. Closing eyes during the workout creates a sleep like feeling and you may get dizzy. This is because your body and brain resists to do the exercise empty stomach in the morning and there aren't much Carbs in your body. At this time if you close your eyes, then it is like applying brakes to a vehicle which is on uphill slope. Also the exercises listed above have steps in which you have to lie down and in the exercise following you need to step onto a chair. This causes the blood flow to slowdown towards your brain due to gravity and hence causing dizziness.Because there aren't much carbs, the body finds a way for energy from your body FATS, and this is what we want.
  2. If you feel thirsty, drink water ... upto 2-3 sips. Do not drink too much of water.
  3. Never workout in AC room. It resists to raise your body temperature. Body actually burns calories to get it heated up, and you get sweat to cool down your skin. Natural heating and sweating body, both ultimately result in burning calories.
  4. Its good to do the exercise in morning sunlight. Its a good source of Vitamin D.
  5. Do not sit or lie down during the REST timings in the exercise instead keep moving your body or simply walk from one corner to other in the room.
  6. Listen to some good energizing music while doing the exercises.
  7. Exercise should be done by concentration of your mind and not forcing your body to do the exercise. The feeling should come from inside you. To understand the difference, its like the difference between you dancing when some one has asked you to dance and the way you dance when no one is around you on the beats of your favourite song.
  8. Do not take off on weekend for exercise. Remember to do exercise even on the day you fast.

Walking, running, skipping and swimming are some of the best exercises to loose weight. Aged people or Obese people may find it difficult to run / Skipping so they can prefer walking or swimming for an extended time everyday as exercise. While walking for 1 Km, a 80 KG person burns more calories compared to a 60 Kg person under same conditions such as speed, time etc. This is because when you walk or stand at a place, you are actually lifting your weight onto your legs, hence 80 KG person is actually lifting 20 Kgs more than the 60 Kg person resulting in more calories burnt.

What is to burn 200 calories : https://www.youtube.com/watch?v=eml6f9g_Yhw


Breakfast, Lunch and Dinner : 


Some one has rightly said that we should have Breakfast like a king, Lunch as a common man and Dinner as a beggar and its correct considering our daily energy requirements. During the night time when we sleep, our body doesn't require much energy and hence we shall have very less food in dinner, where as in the morning after the morning exercises, our body needs maximum energy to start our day with, hence we should have more breakfast.

Breakfast : I have a bowl of sprouts in my breakfast daily. If bored, I have oats, small pouch of about 40 grams. Sprouts if eaten raw are healthy, but if you have acidity problem have them cooked in a pressure cooker with some salt and pepper on it. Sprouts are a good source of protein. You may also have corn flakes. Breakfast should be done after the exercise. Maintain a gap of 20-30 mins between exercise and breakfast.

Breakfast combining carbohydrates (carrot), natural sugar (dates), natural fats (almond) and proteins (sprouts)

Lunch :  I have 2 chapatis (Indian Bread) and preferably green vegetables with lots of salads such as beetroot, carrot, lemon, onion. If green vegetables are not available prefer legumes. Wheat noodles in chinese food is also fine. But NO rice, paneer or oily items, papad, pickle, sweets. Give preference to have liquid foods such as daal, sambhar, soups, rassam, thin gravy curries. Fill up your plate with salads. If you feel more hungry you may have 1/2 chapati extra in lunch but never in dinner.

Dinner : I have 2 chapatis with green vegetables. All protocols same as lunch, except you should not have that extra 1/2 chapati.

Any time during the day if you feel too hungry, and if you do not have apple with you, have Marie Light Oats biscuits. Keep them in your backpack as a backup source of food. Keep in mind not to have them when you are hungry, because eating only 2 chapatis a day with sprouts in your breakfast, you will definitely be hungry, have an apple instead

This goes on only for first 2 weeks. If you succeed in completing the first 2 weeks, you wont be feeling much hungry later time and you will now have better control on your hunger.
My complete day timetable is follows :

Wake up @ 7.30, get fresh up and be active for some time like clean the room, utensils (of previous night dinner). This actually helps to stretch the body and regularize blood pressure.

8.00 AM  -- Start with 7 minutes and 3 mins workout, 2 rounds each with suitable breaks in between.
8.40 AM -- Take bath.
9.00 AM -- Sprouts / Oats breakfast
9.25 AM -- Get ready and leave for office.
10:00 AM -- Have Watermelon. (Banana only when the weight is stabilised )
11.45 AM -- Have an Apple if you feel hungry
12.45 PM -- Lunch (as per guidelines above)
1.15 PM -- Take a walk or be active for at least for 20-30 mins. Do not sit and work immediately after the lunch
4.30 PM -- Have some fruits like apple
6.00 PM -- After you leave from office, do not sit idle taking your laptop or mobile, instead spend time with kids or people around you or simply go for garden walk or to purchase vegetables (as I do), clean bike etc.
9.15 PM -- Have Dinner
9.45 PM -- Take a night walk for 30 mins in fresh air on terrace.
10.15 PM -- Be active like watch some movie, listen music, talk to friends / home, browsing etc
11.00 PM -- Sleep


Sleep : 

Sleep is one of the important factor when it comes to loose weight. 

Factors such as how well you sleep, at what time you sleep, how much time you are awake after your dinner do matter when you plan to loose weight during your night sleep. Yes, you read it correct. Your body does burn calories even in your sleep.Too much of sleep or very less sleep both causes an imbalance in how your body works. You should at least have 7 hours of continuous sleep every night. You should not sleep in the afternoon especially after the lunch. Sleep / nap is like a hibernation in which body goes in a low power state, hence whatever you eat is kept ON HOLD while you sleep, and when food in your stomach is not processed at proper time, it tends to form into fats (because body did not required much energy when you slept, it converts the food into fats as security storage for energy requirements in future) and hence weight gain. Whatever you eat should be processed as soon as possible to prevent it getting converted into fats. Proteins, being simplest in structure are easily used up by body, followed by carbohydrates and then fats.
Also in the night there should be at least 1.5 hours of gap between your dinner time and sleep time. so that whatever you eat in dinner is processed.


Staying Natural : 

  • Instead of having coldrinks, have fruit juices without sugar. Natural sugars - Fructose is better than the sugar we use in kitchen.
  • Drink water even when you are not thirsty. But don't over force your mind for it. 
  • Use stairs always instead of lifts.
  • Instead of switching ON the fan and cooling your body, use a hand fan which was used in old ages. It manages both purposes we want.
  • Prefer walking (running is best) over using bicycles or motor vehicles.
  • Whatever you eat should not be spicy or with lots of masala. 
  • Workout in open space instead going gym
  • If at all you are having milk, prefer cow milk. It is filled with minerals with least fats in it.
  • Keep your work related things in a packed box inside your brain. Don't let them interfere with your personal life.
  • Eat to live and NOT live to eat.
  • Eat food only when you are hungry, Drink water not only when you are thirsty.
  • Eat food only until your hunger is satisfied and not till your stomach is full.

Day to day activities : 



  • Prefer using stairs at ALL the time. Whether it is your office or home, up-climb or a down-climb, no matter how much urgent work you have. Behave as if there are no elevators. Taking two steps at a time and climbing fast burns more calories than taking one step at a time and climbing gradually. 
  • Prefer walking over bicycle or motorcycle whenever possible.
  • While talking over the phone, prefer standing or walking. You actually lift all your weight (50+ Kg) and move around doing so. Experience those efforts by taking an extra 10 KG (1/5th) weight on your back and doing the same,
  • While in office take small walks in your free time instead sitting on chair. Make sure you don't sit at one place for more than 30 mins. Get a walk for 5 mins.
  • If you want to talk to someone who is your office premises, go to their place instead of chatting / talking over office phone.
  • There are 90% chances that you will skip your breakfast, if you get a high priority work at the start of your day. Skipping breakfast will not only ruin your diet plan but will also not allow you to concentrate on your work. So always prefer taking your breakfast before you start your work for the day.
  • Tell your colleagues that you are on diet plan. The ones who are diet conscious will help you regarding food choices. But stay away from those who make a plan to start diet plan in the morning and during lunch say "From Tomorrow". Such things will only make your plan spoil, loose confidence and control over your mind, NOT unless you have complete dedication for your goal.

Happy Mind :

Spend some time playing some simple games which involve moderate activity and which are also fun to play. Remember, your mentality and mind should be happy natured and you should be confident reducing your weight. The Plan won't help if you have too much work pressure, no fun in your life, if you are in mental stress and not happy.
Try spending weekend time in the activities which you like to do in free time. I use to go to teach children in a school. I also like to spend time with children which makes me happy.

Some of the points which I followed are covered up in the below video : 
https://www.youtube.com/watch?v=HA00ZctGz50


After you have reached your goal : 



  • Continue doing the 7 mins and 3 mins exercises 1 round each. 
  • Continue being diet conscious as usual, but you may enjoy the food of your choice once a week including sweets :)
  • Keep on tracking your weight and do not let it cross a buffer of 3 kgs.
  • By the end of this plan you will come to know which foods are good for you and which are not. You can easily control your weight gain / loss by doing the exercise or monitoring your diet.
  • If you are successful in loosing weight with this plan, share it with your friends and the people who need it.


Before - After :


My few before after pics : No need to tell which is "before" and which is "after", you can easily distinguish it yourself.


Before : 


 




At the end of 1st month : 





At the End of 3rd month : 


At the end of 5th month : At this time I had reduced an extra 1-2 kg 



At the end of 6th month : Weight Stabilized. You can see why it is important to gain some weight at the end of plan.





Thank you. Happy Planning.


Thursday 15 October 2015

Guys, Make your self free tomorrow.. Because Ajit is offering his His Life style card for shopping :)


If planets aren’t your thing (wait, what? who are you?). You live on one of those right

From October 20 to 22, you can view the incredible Orionids Meteor Shower. The shower will occur throughout October, but on the night of October 21 and the morning of October 22, it will hit its peak, often delivering around 20 meteors per hour. It’s made up of the dust trails left behind by comet Halley.
During the week of October 22 to 29, Venus will join the party, and the three planets (Jupiter, Mars and  Venus) will align, with just 5 degrees between them, same as it happened on 30 June 2015. That’s a big deal, because the next planetary trio won’t occur again until January 2021,
Jupiter, Mars, and Venus will be closest together early in the morning on October 26, with Jupiter having such a close encounter with Venus, they’ll form what’s known as a 'double planet' (double star is the actual term) for about 3 hours. "Another grouping of three planets won’t happen again until 10 January 2021,"
If that’s not enough to get you up in the (very early) morning, perhaps the opportunity to catch a glimpse of Mercury will be. 
Mercury rises before the Sun all of this month and is surprisingly easy to see from now through Halloween, All you have to do is just look well below and to the left of our three other morning planets and above the eastern horizon during morning twilight, from about 30 to 45 minutes before sunrise for a bright yellowish-orange 'star'."
October 16 is set to be the best morning for Mercury viewing for this entire year, with its position relative to the Sun - about 18-degrees to the east of it - causing the light reflected off its surface to increase dramatically over the next couple of days, making it easy to see with the naked eye. And if you miss that one, on October 30, Mercury will be brighter than any star in the sky, except the brightest of them all, Sirius.  
(: Clear Skies :)

Wednesday 14 October 2015

Lets Rock.. :)
Hi Guys,

Welcome to Blog world. You can share your experiences here....

lets start this journey :)