SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 delete statement execution time
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

cognos79
Posting Yak Master

USA
241 Posts

Posted - 01/17/2007 :  13:40:41  Show Profile  Reply with Quote
I do have a table with 60,000 records. when i execute delete statement : delete from tablename it takes 58 secs. I am deleting all the records from table. does it really takes 58 secs??? or something wrong with the table.

tkizer
Almighty SQL Goddess

USA
36594 Posts

Posted - 01/17/2007 :  14:00:41  Show Profile  Visit tkizer's Homepage  Reply with Quote
Well it's fully logged, so yes it could take a bit. If you don't have any child tables to worry about, then I'd suggest TRUNCATE TABLE instead.

Tara Kizer
Go to Top of Page

cognos79
Posting Yak Master

USA
241 Posts

Posted - 01/17/2007 :  14:03:38  Show Profile  Reply with Quote
tara...what does fully logged mean. I will try truncate and see
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
36594 Posts

Posted - 01/17/2007 :  14:07:11  Show Profile  Visit tkizer's Homepage  Reply with Quote
It has to do with the transaction log. All rows will be logged in it. For TRUNCATE TABLE though, only the pages deallocations are logged I believe. Someone correct me if I'm wrong. It's one of those days...

Tara Kizer
Go to Top of Page

cognos79
Posting Yak Master

USA
241 Posts

Posted - 01/17/2007 :  15:45:48  Show Profile  Reply with Quote
tara...can i view the transaction log?
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
36594 Posts

Posted - 01/17/2007 :  15:51:17  Show Profile  Visit tkizer's Homepage  Reply with Quote
You need to purchase a third party tool such as Lumigent's Log Explorer to do that.

Tara Kizer
Go to Top of Page

cognos79
Posting Yak Master

USA
241 Posts

Posted - 01/17/2007 :  16:03:39  Show Profile  Reply with Quote
thanks a lot for your answers
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.09 seconds. Powered By: Snitz Forums 2000