This Blog Has Been Moved !

This Blog Has been moved to http://aleemkhan.wordpress.com

Recently, I had an issue with nested transaction in SQL Server, pretty simple thing but I realized that I was'nt taking care of this for most of the T-SQL code I write. Fortunately, never had a problem but I thought I shoud post about this so I could remeber this.

Try running the following T-SQL code in SQL Server

BEGIN TRANSACTION
BEGIN TRANSACTION
-- Some Code
ROLLBACK TRANSACTION
ROLLBACK TRANSACTION

This code simpley throws an error "
The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION". Hey thats strange, I have two BEGIN statements so a I need a couple of ROLLBACKS to Roll them back, it seems logical but actually its not.

Transaction are managed in SQL Server through a transaction count, each new BEGIN TRAN statement adds one to the TRAN Count, and a single Rollback rightly makes the TRAN Count zero, so everything is Rolled back with one Rollback.

I can definately take care of this in my own code, but what happens if I am using a third party proceudre which ROLLBACKS the transaction, how do I know I have to put a ROLLBACK in my own code or not. If an encrypted third party procedure calls Rollback before my code, my procedure will throw error when it calls its Rollback.

The Best Pattern to do this is to use the @@TRANCOUNT variable before EACH ROLLBACK, so the the way ROLLBACK should be called is

IF @@TRANCOUNT > 0
BEGIN
ROLLBACK
END

Neat thing to learn !

Comments

74 comments have been posted.
Posted @ 5:20 AM
I disagree. The behavior is not intuitive.
 

Anonymous Anonymous
Posted @ 10:35 PM
Hey I'd like to thank you for such a terrific made forum!
thought this would be a nice way to make my first post!

Sincerely,
Laurence Todd
if you're ever bored check out my site!
[url=http://www.partyopedia.com/articles/christmas-party-supplies.html]christmas Party Supplies[/url].
 

Anonymous Anonymous
Posted @ 8:39 PM
I will not acquiesce in on it. I over warm-hearted post. Especially the appellation attracted me to review the sound story.
 

Anonymous Anonymous
Posted @ 6:21 PM
Amiable brief and this post helped me alot in my college assignement. Thank you seeking your information.
 

Anonymous Anonymous
Posted @ 9:33 PM
[u][b]Xrumer[/b][/u]

[b]Xrumer SEO Professionals

As Xrumer experts, we possess been using [url=http://www.xrumer-seo.com]Xrumer[/url] for the benefit of a sustained leisure now and know how to harness the colossal power of Xrumer and adapt it into a Banknotes machine.

We also yield the cheapest prices on the market. Diverse competitors will order 2x or square 3x and a lot of the opportunity 5x what we debt you. But we believe in providing prominent mending at a debilitated affordable rate. The entire point of purchasing Xrumer blasts is because it is a cheaper variant to buying Xrumer. So we focusing to support that thought in rebuke and provide you with the cheapest grade possible.

Not simply do we cause the unexcelled prices but our turnaround in the good old days b simultaneously for the treatment of your Xrumer posting is super fast. We intention secure your posting done in the forefront you discern it.

We also produce you with a sated log of affluent posts on contrasting forums. So that you can notice seeking yourself the power of Xrumer and how we hold harnessed it to gain your site.[/b]


[b]Search Engine Optimization

Using Xrumer you can wish to realize thousands upon thousands of backlinks over the extent of your site. Myriad of the forums that your Site you force be posted on get great PageRank. Having your join on these sites can truly expropriate strengthen up some top grade recoil from links and uncommonly as well your Alexa Rating and Google PageRank rating utterly the roof.

This is making your put more and more popular. And with this inflate in reputation as grammatically as PageRank you can expect to witness your area absolutely superiority gamy in those Search Locomotive Results.
Conveyance

The amount of transportation that can be obtained by harnessing the power of Xrumer is enormous. You are publishing your locality to tens of thousands of forums. With our higher packages you may regular be publishing your locale to HUNDREDS of THOUSANDS of forums. Imagine 1 post on a popular forum drive almost always rig out 1000 or so views, with communicate 100 of those people visiting your site. At once create tens of thousands of posts on fashionable forums all getting 1000 views each. Your shipping ordain associate sometimes non-standard due to the roof.

These are all targeted visitors that are interested or exotic about your site. Envision how assorted sales or leads you can succeed in with this titanic figure up of targeted visitors. You are truly stumbling upon a goldmine bright to be picked and profited from.

Remember, Shipping is Money.
[/b]

TRAVERSE B RECOVER YOUR CHEAPLY ERUPTION TODAY:


http://www.xrumer-seo.com
 

Anonymous Anonymous
Posted @ 3:07 PM
[B]NZBsRus.com[/B]
Skip Crawling Downloads With NZB Files You Can Quickly Search HD Movies, PC Games, MP3 Singles, Software and Download Them @ Alarming Speeds

[URL=http://www.nzbsrus.com][B]NZB Search[/B][/URL]
 

Anonymous Anonymous
Posted @ 3:36 AM
Nice dispatch and this mail helped me alot in my college assignement. Thank you for your information.
 

Anonymous Anonymous
Posted @ 4:02 AM
Takings Our Dastardly Prices at www.Pharmashack.com, The Fundamental [b][url=http://www.pharmashack.com]Online Chemist's [/url][/b] To [url=http://www.pharmashack.com]Buy Viagra[/url] Online ! You Can also Apex to Greater Deals When You [url=http://www.pharmashack.com/en/item/cialis.html]Buy Cialis[/url] and When You You [url=http://www.pharmashack.com/en/item/levitra.html]Buy Levitra[/url] Online. We Also Be struck by a Important Generic [url=http://www.pharmashack.com/en/item/phentermine.html]Phentermine[/url] In behalf of the improve of Your Regimen ! We Huckster Choose label [url=http://www.pharmashack.com/en/item/viagra.html]Viagra[/url] and Also [url=http://www.pharmashack.com/en/item/generic_viagra.html]Generic Viagra[/url] !
 

Anonymous Anonymous
Posted @ 1:33 PM
Well I agree but I dream the brief should prepare more info then it has.
 

Anonymous Anonymous
Posted @ 6:06 PM
Someone deleted a variety of links from load2all and sendspace ...

From now, we will use www.tinyurlalternative.com as our default [url=http://www.tinyurlalternative.com]url shortener[/url], so every link will be there and visible for everyone.

You can choose from many great [url=http://kfc.ms]short url[/url] names like:

kfc.ms easysharelink.info jumpme.info megauploadlink.info megavideolink.info mygamelink.info myrapidsharelink.info mytorrentlink.info myurlshortener.com mywarezlink.info urlredirect.info urlshrinker.info weblinkshortener.com youtubelink.info and many others.

They maintain over 60 different ready domains and the [url=http://myurlshortener.com]url shortener[/url] service work well for free without any registration needed.

So we think it is good idea and propose you to use [url=http://urlredirect.info]url redirect[/url] service too!

Thank you.
 

Anonymous Anonymous
Posted @ 11:34 AM
I'm new around here, seems like a cool place though. I'll be around a bit, more of a lurker than a poster though :)
[url=http://acai-berries-and-weight-loss.wetpaint.com]Acai Berry[/url]
Acai Berries
Acai Berry
http://acai-berries-and-weight-loss.wetpaint.com
Acai Berry
 

Anonymous Anonymous
Posted @ 11:38 PM
[b]Website Traffic[/b]

A new way to get traffic to your website. Not only will you get loads of [url=http://www.fastpixeltraffic.com/]traffic[/url] more and more everyday you will also get backlinks with all the other sites on the [url=http://www.fastpixeltraffic.com/]grid[/url] getting you a better search engine ranking which will get you even more [url=http://www.fastpixeltraffic.com/]website traffic[/url].Get on the pixel grid today and let the traffic come to you.Taking the internet by storm.The new way to advertise.

Visit: http://www.fastpixeltraffic.com/
 

Anonymous Anonymous
Posted @ 4:57 AM
It isn't hard at all to start making money online in the underground world of [URL=http://www.www.blackhatmoneymaker.com]blackhat method[/URL], Don’t feel silly if you haven’t heard of it before. Blackhat marketing uses little-known or little-understood ways to produce an income online.
 

Anonymous Anonymous
Posted @ 5:27 PM
Hi all,
I found very good source of finding dofollow high parerank backlinks. Even from real PR10.
I cant imagine value of a real pr10.

I would like to share with you all about how i succeded to rank on 1st page on google.
prseo@hotmail.com
http://Www.playhitmusics.com
 

Anonymous Anonymous
Posted @ 10:05 PM
Howdy,

I keep coming to this website[url=http://www.weightrapidloss.com/lose-10-pounds-in-2-weeks-quick-weight-loss-tips].[/url]You have really contiributed very good info here abdulaleemkhan.blogspot.com. I am sure due to busy scedules we really do not get time to care about our health. Are you really serious about your weight?. Recent Research shows that closely 50% of all United States grownups are either fat or weighty[url=http://www.weightrapidloss.com/lose-10-pounds-in-2-weeks-quick-weight-loss-tips].[/url] Therefore if you're one of these individuals, you're not alone. Its true that we all can't be like Brad Pitt, Angelina Jolie, Megan Fox, and have sexy and perfect six pack abs. Now the question is how you are planning to have quick weight loss? You can easily lose with with little effort. Some improvement in of daily activity can help us in losing weight quickly.

About me: I am blogger of [url=http://www.weightrapidloss.com/lose-10-pounds-in-2-weeks-quick-weight-loss-tips]Quick weight loss tips[/url]. I am also health expert who can help you lose weight quickly. If you do not want to go under difficult training program than you may also try [url=http://www.weightrapidloss.com/acai-berry-for-quick-weight-loss]Acai Berry[/url] or [url=http://www.weightrapidloss.com/colon-cleanse-for-weight-loss]Colon Cleansing[/url] for effective weight loss.
 

Anonymous Anonymous
Posted @ 11:27 AM
Arrange the awfulness with two backs casinos? with upon this advanced [url=http://www.realcazinoz.com]casino[/url] superintend and have the r“le in the service of the benefit of a upon out against up online casino games like slots, blackjack, roulette, baccarat and more at www.realcazinoz.com .
you can also inspection in view our lately [url=http://freecasinogames2010.webs.com]casino[/url] require at http://freecasinogames2010.webs.com and conquer out-and-out compressed dough !
another … la mode [url=http://www.ttittancasino.com]casino spiele[/url] diagram is www.ttittancasino.com , expropriate in behalf of german gamblers, sequel as a be revealed during magnanimous online casino bonus.
 

Anonymous Anonymous
Posted @ 4:09 AM
Approvingly your article helped me altogether much in my college assignment. Hats incorrect to you post, choice look forward in the direction of more related articles soon as its sole of my pet topic to read.
 

Anonymous Anonymous
Posted @ 6:26 AM
Howdy,

Do you guys watch movies in theater or on internet? I use to rent DVD movies from [b]Blockbuster.com[/b]. Recently I discovered that we can watch all new movies on internet on day, they are released. So why should I spend money on renting movies??? So, can you guys please tell me where I can [url=http://www.watchhotmoviesfree.com]watch latest movie Despicable Me 2010[/url] for free?? I have searched [url=http://www.watchhotmoviesfree.com]Youtube.com[/url], [url=http://www.watchhotmoviesfree.com]Dailymotion.com[/url], [url=http://www.watchhotmoviesfree.com]Megavideo.com[/url] but, Could not find a good working link. If you know any working link please share it with me.


Thanks
 

Anonymous Anonymous
Posted @ 8:53 PM
Sup im new here, I found this board very helpful & it has helped me tonns. i should be able to help out & help other ppl like it has helped me.

I love to have fun [url=http://watch-family-guy-free.warlordz.co.uk]watch family guy now[/url] this helps burn some of time.

Thxs, See you about.
 

Anonymous Anonymous
Posted @ 5:28 PM
Generic Viagra is the world renowned medicine for erectile dysfunction and most men have forgotten they ever had a problem with erections after its use. Take it on empty stomach and it will work in 30 minutes. Erections can be achieved on stimulation.Generic Viagra is a need based pill and should be taken only when you plan to indulge in sexual activity. Generic Propecia is a wonderful medicine for men suffering hair loss and who are at risk of getting completely or partially bold. Propecia can also help you at the beginning stages of some prostatic problems. Viagra improves erections for most men no matter how long they have had erectile dysfunction, taken approximately 30 minutes before your plan of sexual activity and works on stimulation for around 4 hours.Generic Cialis is in a medications in the class known as PDE-5 inhibitor, which is used to treat impotence in men. Generic Levitra is the third treatment in the same class as Viagra and Cialis – all being medicines prescribed to men with erectile dysfunction.
 

Anonymous Anonymous
Posted @ 10:59 AM
Very shorts, simple and easy to understand, bet some more comments from your side would be great
 

Anonymous Anonymous
Posted @ 10:53 AM
Infatuation casinos? assess this unversed [url=http://www.realcazinoz.com]casino[/url] turn away from and cover mad up online casino games like slots, blackjack, roulette, baccarat and more at www.realcazinoz.com .
you can also descry visible our up to trendy [url=http://freecasinogames2010.webs.com]casino[/url] jumble from suppress to demanding at http://freecasinogames2010.webs.com and substitute instead of in drift folding metamorphose !
another lone [url=http://www.ttittancasino.com]casino spiele[/url] concatenation of events is www.ttittancasino.com , because german gamblers, protect across unstinting [url=http://www.realcazinoz.com]online casino[/url] bonus. so check this leading [url=http://www.omniget.co.il]online casino[/url] for free [url=http://www.casinosaction.com]casino bonus[/url] and 100's of online [url=http://www.thecasino.co.il]casino[/url] games.
 

Anonymous Anonymous
Posted @ 2:32 AM
Look for lenders who can offer secured loans, loan industry exists to baffle Roger than help your financial situation. You got to be will send your assets to once it is Christian. [url=http://cleverpaydayloans.co.uk]payday loans for unemployed[/url] In case you ask for a bashful a mass of of assets it Roger is advisable to you're your casual expenses will can be paid for in the affianced. Some experts say it's as a bit complicated, due to the high expenses that come on the way.
 

Anonymous Anonymous
Posted @ 2:47 PM
how to buy viagra online online pharmacy viagra fast delivery - get cheap viagra online
 

Anonymous Anonymous
Posted @ 8:11 PM
dating site reviews http://loveepicentre.com/ singles dating site in germany
 

Anonymous Anonymous
Posted @ 2:08 AM
viagra sildenafil viagra dosage maximum - can you buy viagra online
 

Anonymous Anonymous
Posted @ 5:58 AM
viagra online without prescription buy generic viagra 50mg - viagra by mail
 

Anonymous Anonymous
Posted @ 5:08 AM
order viagra buy viagra with paypal us - order viagra online us
 

Anonymous Anonymous
Posted @ 6:19 PM
viagra online without prescription viagra online doctor - buy viagra online generic
 

Anonymous Anonymous
Posted @ 9:22 AM
soma drug soma online no prescription overnight delivery - online somali dating
 

Anonymous Anonymous
Posted @ 9:07 AM
top [url=http://www.c-online-casino.co.uk/]casino games[/url] brake the latest [url=http://www.realcazinoz.com/]realcazinoz.com[/url] unshackled no deposit hand-out at the chief [url=http://www.baywatchcasino.com/]loose bonus casino
[/url].
 

Anonymous Anonymous
Posted @ 10:32 PM
buy soma online what drug is soma classified as - soma xmas frisco
 

Anonymous Anonymous
Posted @ 8:19 PM
buy cheap soma buy soma muscle relaxant online - soma bras discount code
 

Anonymous Anonymous
Posted @ 2:18 AM
paleo diet ebook http://audiobookscollection.co.uk/Embracing-Fear-How-to-Turn-What-Scares-Us-into-Our-Greatest-Gift/p168986/ lotto millions ebook [url=http://audiobookscollection.co.uk/fr/Sybex/c2444/]brandon fox ebook[/url] picking up female cops ebook
 

Anonymous Anonymous
Posted @ 10:46 AM
buy soma online no prescription soma of san diego - take soma pills
 

Anonymous Anonymous
Posted @ 7:58 PM
tramadol 50mg buy tramadol cod online - ultram side effects insomnia
 

Anonymous Anonymous
Posted @ 7:04 AM
buy tramadol no prescription tramadol 50 mg can you get high - tramadol hcl an 627
 

Anonymous Anonymous
Posted @ 8:54 PM
the conservative mind russell kirk ebook http://audiobookscollection.co.uk/es/Not-Everyone-Gets-A-Trophy-How-to-Manage-Generation-Y/p223328/ ebook stop your childs tics today [url=http://audiobookscollection.co.uk/Understanding-the-Medical-Diagnosis-of-Child-Maltreatment-A-Guide-for-Nonmedical-Professionals/p227197/]hoodoo ebook[/url] mind reading secrets ebook
 

Anonymous Anonymous
Posted @ 3:58 AM
free python for dummies ebook http://audiobooksworld.co.uk/Backward-Christian-Soldiers/p212742/ ebook uml jacobson booch [url=http://audiobooksworld.co.uk/it/Cases-on-Online-and-Blended-Learning-Technologies-in-Higher-Education-Concepts-and-Practices/p226494/]ebook download memberships[/url] make money free ebook
 

Anonymous Anonymous
Posted @ 6:35 AM
medical problems in dentistry ebook http://audiobooksworld.co.uk/authors/?letter=Pl katharine kerr the gold falcon ebook [url=http://audiobooksworld.co.uk/de/Louis-A-D-Alotto/m77660/]rockwell trading ebook[/url] boutique diy ebook
 

Anonymous Anonymous
Posted @ 3:54 AM
generic xanax buy cheap xanax uk - xanax effects on blood pressure
 

Anonymous Anonymous
Posted @ 7:38 PM
order xanax no prescription xanax side effects in dogs - discount xanax no prescription
 

Anonymous Anonymous
Posted @ 6:26 PM
xanax 2mg buy xanax online legitimate - generic brand names xanax
 

Anonymous Anonymous
Posted @ 1:29 PM
buy tramadol cheap online can you buy tramadol over the counter in usa - tramadol online american pharmacy
 

Anonymous Anonymous
Posted @ 6:42 PM
carisoprodol 350 mg carisoprodol dosage information - buy carisoprodol cod
 

Anonymous Anonymous
Posted @ 11:32 PM
carisoprodol 350 mg carisoprodol 350 mg dan - soma carisoprodol drug test
 

Anonymous Anonymous
Posted @ 1:38 PM
carisoprodol 350 mg carisoprodol tablets usp 350 mg - carisoprodol detection drug test
 

Anonymous Anonymous
Posted @ 11:37 PM
buy carisoprodol carisoprodol 350 mg blood pressure - buy carisoprodol cod
 

Anonymous Anonymous
Posted @ 3:28 AM
accounting software for a general contractor http://buyoem.co.uk/it/product-18535/MacDust-2-Mac win 31 software [url=http://buyoem.co.uk/product-36177/EnBackup-1-0]bowling score software[/url] shopping cart software license
[url=http://buyoem.co.uk/product-35664/Adobe-InDesign-Server-CS5-5-7-5-Multilingual]Adobe InDesign Server CS5.5 7.5 Multilingual - Software Store[/url] dvd840d nero software
[url=http://buyoem.co.uk/product-18535/MacDust-2-Mac][img]http://buyoem.co.uk/image/2.gif[/img][/url]
 

Anonymous Anonymous
Posted @ 10:59 AM
buy tramadol tramadol manufacturer - tramadol for dogs+urination
 

Anonymous Anonymous
Posted @ 3:31 PM
carisoprodol 350 mg medication soma carisoprodol - carisoprodol hydrocodone
 

Anonymous Anonymous
Posted @ 10:52 PM
buy tramadol online buy tramadol online mastercard - order tramadol cod next day delivery
 

Anonymous Anonymous
Posted @ 11:35 PM
order cialis online canada order generic cialis us - buy cialis online discount
 

Anonymous Anonymous
Posted @ 11:35 PM
carisoprodol 350 mg carisoprodol and alcohol use - soma 250 mg carisoprodol tablets
 

Anonymous Anonymous
Posted @ 4:02 PM
xanax online buy xanax no prescription usa - xanax side effects pregnant women
 

Anonymous Anonymous
Posted @ 7:41 PM
tadalafil no prescription cost daily cialis nz - cialis online to usa
 

Anonymous Anonymous
Posted @ 9:48 PM
buy cialis in usa cialis price us - where to buy cheap cialis online
 

Anonymous Anonymous
Posted @ 1:04 AM
xanax online 10 xanax bars - xanax 0.25mg
 

Anonymous Anonymous
Posted @ 5:59 AM
xanax online cheap xanax overnight - xanax overdose how much is too much
 

Anonymous Anonymous
Posted @ 4:51 PM
cialis online cialis 30 day coupon - cialis daily how long to take effect
 

Anonymous Anonymous
Posted @ 6:55 AM
cialis online cialis 5mg dosage - can you buy cialis over the counter in thailand
 

Anonymous Anonymous
Posted @ 10:38 PM
http://buytramadolonlinecool.com/#61458 tramadol withdrawal in a neonate - tramadol addiction treatment program
 

Anonymous Anonymous
Posted @ 10:55 PM
buy klonopin online will .5mg klonopin get you high - klonopin withdrawal vision
 

Anonymous Anonymous
Posted @ 7:44 PM
http://landvoicelearning.com/#38471 tramadol withdrawal symptoms dizziness - tramadol street value
 

Anonymous Anonymous
Posted @ 4:47 AM
http://buytramadolonlinecool.com/#73892 tramadol for dogs uses - tramadol for dogs anti inflammatory
 

Anonymous Anonymous
Posted @ 9:46 AM
buy tramadol online no prescription cheap buy tramadol missouri - buy tramadol online no rx
 

Anonymous Anonymous
Posted @ 1:27 PM
buy klonopin online possible side effects klonopin - how to buy klonopin
 

Anonymous Anonymous
Posted @ 5:36 AM
http://www.integrativeonc.org/adminsio/buyklonopinonline/#3081 is klonopin used for alcohol withdrawal - klonopin for flying
 

Anonymous Anonymous
Posted @ 6:52 PM
lorazepam online ativan recreational use dosage - what does generic ativan look like
 

Anonymous Anonymous
Posted @ 9:50 PM
carisoprodol online what are soma carisoprodol tablets - buy carisoprodol online no prescription needed
 

Anonymous Anonymous
Posted @ 2:08 PM
carisoprodol online buy carisoprodol usa - carisoprodol online no prescription cod
 


Anonymous Anonymous
Posted @ 5:45 PM
m0868 login dating http://loveepicentre.com/faq/ best uk sex dating sites
cougar dating website [url=http://loveepicentre.com]dating jacksonville christians[/url] medical marijuana dating service
mars vnus dating [url=http://loveepicentre.com/advice/]pacific dating online for singles[/url] internet dating services online [url=http://loveepicentre.com/user/vivian2010/]vivian2010[/url] dating sim games xxx