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 2005 Forums
 Transact-SQL (2005)
 DELETE

Author  Topic 

WoodHouse
Posting Yak Master

211 Posts

Posted - 2009-09-22 : 05:51:50
Hi

I try to delete the records ...

but the delete statement is running more then 30 mins...


DELETE FROM TABLE_NAME

please help out this...

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2009-09-22 : 05:58:57
If you want to delete entire table, use Truncate

Truncate table <table_name>

See the diff b/w Delete & Truncate in BOL

Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled

http://senthilnagore.blogspot.com/
Go to Top of Page

WoodHouse
Posting Yak Master

211 Posts

Posted - 2009-09-22 : 07:13:28
Hi senthil

Thanks for ur reply

i know truncate is faster then delete..

But the problem is different we have to think lock and delete hang....




Go to Top of Page

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2009-09-22 : 09:08:42
Change ur server in single-user-mode and do what ever you want.(server was not accessible by others)

Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled

http://senthilnagore.blogspot.com/
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-09-22 : 09:32:07
quote:
Originally posted by WoodHouse

Hi

I try to delete the records ...

but the delete statement is running more then 30 mins...


DELETE FROM TABLE_NAME

please help out this...




Do you want to delete all the rows from the table?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -