Sunday, May 6, 2007

Can we look into LOG file?

In SQL Server 2005 with fn_dblog function you can get more info about what's happening in SQL Server. MS has added a new data like 'partitionid' column for example.

Let us do some testing

USE Demo
--create a table for testing
CREATE TABLE dbo.Test1 (c INT)
--populate the table with data

WITH numbers AS
(SELECT 1 as Num
UNION ALL
SELECT Num + 1 FROM numbers WHERE Num <10)
INSERT INTO dbo.Test1 SELECT Num FROM numbers OPTION(Maxrecursion 10)

--delete the data
DELETE FROM dbo.Test1

In order to identify how many 'DELETE' operation and when does it start? Run the followinq query.

SELECT [Transaction Name],[begin time FROM ::fn_dblog( NULL,NULL)WHERE [Transaction Name] ='DELETE'

Ok, the next step I'd like to know how long does DELETION take? So we have [end time column] for this purpose. We need to write the below query which gets little complicated.

WITH cte_delete
AS
(
SELECT [Transaction Name],[begin time],[end time]
FROM ::fn_dblog( NULL,NULL)d
WHERE [begin time] IS NOT NULL OR [end time]IS NOT NULL
) ,cte_d
AS
(
SELECT [Transaction Name],[begin time],(SELECT MIN([end time]) FROM cte_delete C
WHERE cte_delete.[begin time]<=C.[end time])AS [end time]
FROM cte_delete WHERE [Transaction Name] ='DELETE' OR
[Transaction Name] IS NULL
)
SELECT * FROM cte_d
WHERE [begin time] IS NOT NULL OR [end time]IS NOT NULL

Also take a look at 'Operation' column.

SELECT Operation,AllocUnitName,[Transaction Name],[begin time],[end time]
FROM ::fn_dblog( NULL,NULL)
WHERE Operation ='LOP_DELETE_ROWS' OR [Transaction Name]='DELETE'

To identify which tables are being hit by DELETE operation.

SELECT AllocUnitName, COUNT([Current LSN])
FROM ::fn_dblog(NULL,NULL )
WHERE Operation = N'LOP_DELETE_ROWS'
GROUP BY AllocUnitName

42 comments:

dhd said...

EVEN by wow gold the standards gold in wowd of the worst financial buy wow gold crisis for at least wow gold cheap a generation, the events of Sunday September 14th and the day before were extraordinary. The weekend began with hopes that a deal could be struck,maplestory mesos with or without government backing, to save Lehman Brothers, America''s fourth-largest investment bank.sell wow gold Early Monday buy maplestory mesos morning Lehman maplestory money filed for Chapter 11 bankruptcy protection. It has more than maplestory power leveling $613 billion of debt.Other vulnerable financial giants scrambled maple money to sell themselves or raise enough capital to stave off a similar fate. billig wow gold Merrill Lynch, the third-biggest investment bank, sold itself to Bank of America (BofA), an erstwhile Lehman suitor,wow power leveling in a $50 billion all-stock deal.wow power leveling American International Group (AIG) brought forward a potentially life-saving overhaul and went maple story powerleveling cap-in-hand to the Federal Reserve. But its shares also slumped on Monday.

chengja said...

Alex Rodriguez,the playerwow goldwho would restore integrity to baseball's homewow goldrunre cord,admittedwow goldMonday towow goldusing performance-enhancingwow goldwow golddrugs himself.

chengja said...

The All-Star thirddofus kamasdofus kamasbaseman said in an interviewkamas dofusacheter dofuswith ESPN that he used steroids with the Texas Rangers for three years,from 2001-03,in an attemptbuy kamasacheter kamasto justify his status as the game's highest-paid player after signing a 10-year.

chengja said...

Back then it wasworld of warcraft golda different culture,Rodriguezcheap wow goldsaid.It waswow orvery loose.I was young.I waswow power levelingstupid.

chengja said...

He said he quitbuy wow goldcheap wow goldafter 2003,hiswow power levelingdofus kamasfirst of three AL MVP seasons,because I've provedbuy ffxi gilLord of the Rings Online goldto myself and to everyone that I don't need any of that.

chengja said...

When I arrivedwow goldin Texas in 2001,Iwow goldfelt an enormous amount of pressure.I feltwow goldwow goldlike I had all the weightwow goldof the world on top of me and I needed to perform.

xuemei said...

welcome to the wonderland Gold , in here you can buy the wonderland online Gold, do you know that the wonderland money in the game is very important, if you had more cheap wonderland online Gold, I think you can get the tall level, quickly come here to buy wonderland Gold.

xiaoqiu said...

Even it got me crazy enough to buy Guild Wars Prophecies with some my own GuildWars Gold and Nightfall and Eye of the North. I wonder to know why are not you guys and gals who like the PVP concept buying this awesome game. okey, it is expensive to buy gw gold all parts. If you lack the GuildWars money, but it is worth it and no monthly costs and the game gets updated weekly at least. Once again, if anyone wants to play Guild Wars sometime add me to friends here Guild Wars Gold. And realize how much cheap gw gold I bought in the last couple of weeks, months, years. So I found this Guild Wars Factions and installed it.

song said...

wow gold
wow gold
eve isk
wow power leveling
wow power leveling
wow power leveling
wow power leveling
warhammer gold
warhammer power leveling
bestchina traveland
uggsor
ghd straighteners

Cardi Ugg Boots
Classic Short Ugg Boots

Classic Tall Ugg Boots
Metallic Ugg Boots

Mini Ugg Boots
Sundance Ugg Boots

tiffany Jewelry

xw said...

By the way, I recommend you buy the cheapest Atlantica online Gold and Atlantica power leveling from us where the prices here are low. So if you have the Atlantica Gold is useful to your level spear and then you should buy Atlantica online Gold. In addition if you need to buy goods for your characters, the game provides you the cheap Atlantica online Gold. And the last, you can make the fun of the Atlantica online money in the Atlantica online world.
Follow the guide below, you will have a better experience in dofus kamas. Because of Bambooto attack with both earth and wind damage, with also heals kamas. There are some cheap kamas in the Dofus and that is very useful. The best part is that bulbiflor can drop bulbiflor magic bark, which sells for 50000 dofus gold. They sell well kamas anytime too, so you can buy dofus kamas at anytime.

said...

You know ,I have some priston tale Gold, and my friend also has some
priston tale Money, do you kouw they have the same meaning,I just want to
buy priston tale Gold, because there are many
cheap priston tale Gold.
You know ,I have some shadow of legend Gold, and my friend also has some
sol gold, do you kouw they have the same meaning,Both of them can be called
shadow of legend money,I just want to
buy shadow of legend Gold, because there are many
cheap shadow of legend Gold.

lanzi said...

I can get Solstice Kron cheaply.
Yesterday i bought Solstice Online Kronfor my brother.
i hope him like it. i will give Solstice Gold to him
as birthday present. i like the Solstice Online money very much.
I usually buy cheap Solstice Kron and keep it in my store.
I can get Megaten Gold cheaply.
Yesterday i bought Megaten online Gold for my brother.
i hope him like it. i will give Megaten money to him
as birthday present. i like the cheap Megaten Gold very much.
I usuallybuy Megaten Gold and keep it in my store.
I enjoy the Megaten online money.

xw said...

The twelve sky Gold should be a timely evolution of the world. Please step up efforts to investigate all types of 12sky gold can be set up in the game. 12Sky Silver Coins to add more rudimentary fashion. The twelvesky Gold can help you combat equipment of the production. Use the 12 sky gold may change the door to door battle for offensive and defensive resident.
For the wakfu kamas, I believe everyone is familiar with the game. For the wakfu gold, I want to say a few points. You must be able to attract firepower with buy wakfu kamas. Originally playing specter in the wakfu money is a stimulating live. Important point is that wakfu kama when CT can hear breathing PS.

qwe said...

rappelz rupees of Rappelz Online Game has more functions and this Rappelz Game is a very good free game. This rappelz gold of score could go down A LOT if they choose to mess up the classes even more. I would have rated it much cheap rappelz rupees better when it was epic3. If yes, then the first step to buy rupees when you play Rappelz is for you. Play rappelz and feel the power and might of rappelz money. See you in game!
rohan crone has many ways for us to use. When you start the Rohan Online game, your character will be level 1. I remembered that when I started playing this Rohan game with some little cheap rohan money. My friends all told me that the best way to spend rohan online gold is a good way. But I could not like spending my own rohan online crone. If you do not like upgrading level step by step, you can cost rohan gold to help your character to reach level high.

fangyan said...

As a new player , you may need some game guides or information to enhance yourself.
angels gold is one of the hardest theme for every class at the beginning . You must have a good way to manage your angels online gold.If yor are a lucky guy ,you can earn so many buy angels goldby yourself.If you need , you cancheap angels online goldat our website . Go to the related page and check the detailed information . Once you have any question , you can connect our customer service at any time .


Making Sho Online Mun is the old question : Honestly there is no fast way to make lots of Sho Mun . Sadly enough a lot of the people that all of a sudden come to with millions of Sho Online gold almost overnight probably duped . Although there are a lot of ways to make lots of Sho gold here I will tell you all of the ways that I know and what I do to buy Sho Online gold.

rhtehe said...

Do you know the Archlord gold, in the game you need the
Archlord money. it can help you increase your level. My friends always asked me how to
buy Archlord gold, and I do not know he spend how much money to buy the
archlord online Gold, when I see him in order to play the game and search which the place can buy the
cheap Archlord gold. I am happy with him.
Do you know the cabal alz , in the game you need the
cabal gold. it can help you increase your level. My friends always asked me how to
buy cabal alz, and I do not know he spend how much money to buy the
cabal money, when I see him in order to play the game and search which the place can buy the
cabal online alz. I am happy with him.

yanhui said...

Once I played habbo, I did not know how to get strong, someone told me that you must have habbo credits. He gave me some habbo gold, he said that I could buy habbo gold, but I did not have money, then I played it all my spare time. From then on, I got some habbo coins, if I did not continue to play it, I can sell cheap habbo credits to anyone who want.


Once I played hero, I did not know how to get strong, someone told me that you must have hero gold. He gave me some hero online gold, he said that I could buy hero gold, but I did not have money, then I played it all my spare time. From then on, I got some hero online money, if I did not continue to play it, I can sell hero money to anyone who want.

cheap wow gold said...

If you are cheap wow gold trying any unknown cheats to earn gold, you would cheapest wow gold face some problem and your account will be black out. So don't try to wow gold find cheats instead try to world of warcraft gold sale follow the guideline of world of warcraft. These tips could Cheap Wow Goldwork as gold cheat and can help a lot to earn gold and money. World of Warcraft is the most exiting online game and while Playing the game most of the players struggle wow power leveling to earn a lot of gold.

Most of the players World Of Warcraft Goldtry search cheat code for this game to earn gold. This wow gold cheaparticle will help Wow Goldyou a lot to earn more and more gold.The best way to earn gold in this online game is by going through the guidelines wow gold for saleand other information about itemchannel.comthe game that are available on the internet .

春香 said...

Making Rose zuly is the old question : Honestly there is no fast way to make lots of rose zulie . Sadly enough a lot of the people that all of a sudden come to with millions of rose online zuly almost overnight probably duped . Although there are a lot of ways to make lots of rose online zulie here I will tell you all of the ways that I know and what I do to Arua ROSE zuly.

春香 said...

As a new player , you may need some game guides or information to enhance yourself.
knight gold is one of the hardest theme for every class at the beginning . You must have a good way to manage your knight noah.If yor are a lucky guy ,you can earn so many knight online gold by yourself . But if you are a not , I just find a nice way to get knight online noah. If you need , you can buy cheap knight gold at our website . Go to the related page and check the detailed information . Once you have any question , you can connect our customer service at any time .

haiyanlei04 said...

Although the game is free to play, we have to cost some shaiya money to buy our favorite equipment. shaiya gold is the important one in the Shaiya Game, when I begin to come into contact with the wonderful Online Game. Every one also likes playing this Shaiya game with some shaiya online gold. Their primary goal of cheap shaiya gold is not damage infliction, but rather keeping foes away from other party members. So I have decided to buy shaiya gold to try playing this game first.
Play rappelz and feel the power and might of rappelz money. See you in game! If yes, then the first step to buy rupees when you play Rappelz is for you. rappelz rupees of Rappelz Online Game has more functions and this Rappelz Game is a very good free game. This rappelz gold of score could go down A LOT if they choose to mess up the classes even more. I would have rated it much cheap rappelz rupees better when it was epic3.

said...

You know ,I have some kal geons, and my friend also has some
kal gold, do you know they have the same meaning, Both of them can be called
kal online geons,I just want to buy some
kal online gold, because there are many
kalonline Geons.

said...

You know ,I have some shadow of legend Gold, and my friend also has some
sol gold, do you know they have the same meaning,Both of them can be called
shadow of legend money,I just want to buy shadow of legend Gold, because there are many cheap shadow of legend Gold.

lanzi said...

I can get Solstice Kron cheaply.
Yesterday i bought Solstice Online Kronfor my brother.
i hope him like it. i will give Solstice Gold to him
as birthday present. i like the Solstice Online money very much.
I usually buy cheap Solstice Kron and keep it in my store.

I can get Solstice Kron cheaply.
Yesterday i bought Solstice Online Kronfor my brother.
i hope him like it. i will give Solstice Gold to him
as birthday present. i like the Solstice Online money very much.
I usually buy cheap Solstice Kron and keep it in my store.

yanhui said...

Once I played habbo, I did not know how to get strong, someone told me that you must have habbo credits. He gave me some habbo gold, he said that I could buy habbo gold, but I did not have money, then I played it all my spare time. From then on, I got some habbo coins, if I did not continue to play it, I can sell cheap habbo credits to anyone who want.

Once I played habbo, I did not know how to get strong, someone told me that you must have habbo credits. He gave me some habbo gold, he said that I could buy habbo gold, but I did not have money, then I played it all my spare time. From then on, I got some habbo coins, if I did not continue to play it, I can sell cheap habbo credits to anyone who want.

xuemei said...

Now do you worried about that in the game do not had enough aion kina to play the game, now you can not worried, my friend told me a website, in here you can buy a lot aion online kina and only spend a little money, do not hesitate, it was really, in here we had much aion gold, we can sure that you will get the cheap aion kina, quick to come here to buy aion kina.

products said...

China Wholesale has been described as the world’s factory. This phenomenom is typified by the rise ofbusiness. Incredible range of products available with China Wholesalers “Low Price and High Quality” not only reaches directly to their target clients worldwide but also ensures that wholesale from china from China means margins you cannot find elsewhere and buy products wholesaleChina Wholesale will skyroket your profits.wedding dressescheap naruto cosplayanime cosplay

products said...

Women’s nike tn Shox Rivalry est le modèle féminin le plus tendance de baskets pour le sport. tn chaussuresConcernant la semelle :spyder jacketsCheap Brand Jeans Shop - True Religion Jeans cheap nike shox & Puma Shoes Online- tn nike,Diesel Jeans le caoutchouc extérieur, l’EVA intermédiaire Levis Jeanset le textile intérieur s’associent pour attribuer à la.ed hardy shirts pretty fitCharlestoncheap columbia jackets. turned a pair of double plays to do the trick.Lacoste Polo Shirts, puma basket, Burberry Polo Shirts.wholesale Lacoste polo shirts and cheap polo shirtswith great price.Thank you so much!!cheap polo shirts men'ssweate,gillette mach3 razor bladesfor men.As for Cheap Evisu JeansCheap Armani Jeanspolo shirtsPuma shoes

Replica Watches said...

29047126483369175 I play dofus Replica Watches for one year, I Replica Rolex Watches want to get some Replica Watch kamas to buy Replica Chanel Watches item for my character. So, I search "Replica Swiss Watches" on google and found many website. As Exact Replica Graham Watch the tips from the forum, I just review the Swiss Replica Watches websites and choose some Replica Montblanc Watches quality sites to Replica Cartier Watches compare the price, and go to their Replica Breguet Watches online support to make Replica Breitling Watches the test. And Last Chaos Gold I decide to use Replica BRM Watch at the end. And Tag Heuer Replica Watch that is the Replica IWC Watch beginning..

fdsgfd said...

Replica B.R.M Watches
Replica Baume & Mercier Watches
Replica Bell & Ross Watches
Replica bmw Watches
Replica breguet Watches
Replica breitling Watches
Replica bvlgari Watches
Replica cartier Watches
Replica chanel Watches
Replica dior Watches
Replica concord Watches
Replica corum Watches
Replica D&G Watches
Replica De Witt Watches
Replica ebel Watches
Replica Emporio Armani Watches
Replica Fendi Watches
Replica ferrari Watches
Replica Fortis Watches

tong said...

Christian Louboutin Pumps
Christian Louboutin Sandals
christian louboutin heels
Christian Louboutin Short Boots
Christian Louboutin Spring Collection
Christian Louboutin Tall Boots
discount Christian Louboutin Boots
discount Christian Louboutin Pumps
discount Christian Louboutin Sandals
discount christian louboutin heels
discount Christian Louboutin Short Boots
discount Christian Louboutin Tall Boots
Christian Louboutin Boots Sale
Christian Louboutin Pumps sale
Christian Louboutin Sandals sale

yiran said...

Your blog is very good, it's the best blog I've ever seen, thank you!
By the way, do you like polo shirts, which are very chic, especially the polo t shirts, I love them very much. I also like playing tennis rackets, it can keep healthy, what do you like to do?
polo t shirts women
polo t shirts on sale
polo t shirts for women
polo shirts on sale
polo shirts men
men's polo shirt
men polo shirt
mens polo shirts
mens polo shirt
cheap polo shirts
discount polo shirts
men's polo shirts
women's polo shirts
cheap tennis racket
discount tennis racket
prince tennis racquet
head tennis rackets
wilson tennis racket
babolat tennis racquet

virstock.com said...

Dofus Kamas|Prix Moins Cher Dofus Kamas|Kamas par allopass|Dofus kamas audiotel|Dofus kamas par telephone sur Virstock.com

Meilleur prix dofus kamas stock de dofus kamas

Prix moins cher dofus kamas
vente dofus kamas sur www.virstock.com

Kamas par allopass sur dofus kamas

Dofus kamas par telephone sur dofus kamas

Dofus kamas audiotel sur dofus kamas

http://www.virstock.com/jsp/comments.jsp dofus kamas vente

http://www.virstock.com

niketn123 said...

Buy best quality generic Air Shoeswith 100% satisfaction guaranteed at generic Sildenafil Citrate is Chaussures Sportsand secure, buy Viagra online. and Order Cheap Viagra Prescription with nike tn Buy Cheap Generic Viagra
Using standard ed hardy clothingof CPR cardio pulmonary buy viagra china Some groin or arm and is China Wholesaletool to treat and

Nicole C said...

buy viagra
viagra online
generic viagra

King Bayern Munich said...

This is a great article, supplies the useful information for me, thanks in this
soft sofa
Modern-stone-sculpture
billiards
Long span shelving
baby stroller
oil paintings
outdoor ceramic tiles
casual shoes
oil paintings

aiya said...
This comment has been removed by a blog administrator.
nedox said...
This comment has been removed by a blog administrator.
luck said...

uggs clearance (2) car sales. 3. "Consumer Reports" ratings. Although some models have a very long history, has many loyal fans, such as the Volkswagen Jetta (picture quotation parameters Forum), but the facelift to the present, many models it is almost just a change of face, and not with the quality of the vehicle development and improve the car, Uggs Outlet but look old and outdated. Here let us look at the foreigners in this assessment: "A nine worst U.S. Forbes assessment models.classic short ugg boots"Note: The following models are the U.S. version, with domestic sales model specifications may vary. U.S. data from MSN, Forbes and Consumer Reports ugg boots clearance.

diablo ti said...

This topic is pretty good and the writer's views are unique and not so hard to understand.I like it very much, and by the way I want to share some interesting and very useful websites to you:www.rsorder.com! Iam sure you can find out funny things there.

runescape gold

rs gold

cheap rs gold

buy runescape gold

pan cherry said...

That is really cool. Thanks for finding it. Some really good ideas there, this is going to be a real time sink. I am a china tour lover,You can learn more: China tourism | China travel service | China vacation packages

Learn Chinese language on hanbridgemandarin said...

Since our founding in 2002, Hanbridge Mandarin has provided thousands of learners with high-quality campus-based courses, online classes, and intensive cultural immersion programs. Utilizing?easy, fun and rewarding methods, we work hard to ensure our students can understand, use and ultimately master Mandarin communication skills.

More Chinese learning tags : Learn Chinese | learn Chinese online | learn mandarin