Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 delete statement execution time

Author  Topic 

cognos79
Posting Yak Master

241 Posts

Posted - 2007-01-17 : 13:40:41
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

38200 Posts

Posted - 2007-01-17 : 14:00:41
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

241 Posts

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

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-01-17 : 14:07:11
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

241 Posts

Posted - 2007-01-17 : 15:45:48
tara...can i view the transaction log?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-01-17 : 15:51:17
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

241 Posts

Posted - 2007-01-17 : 16:03:39
thanks a lot for your answers
Go to Top of Page
   

- Advertisement -