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
 General SQL Server Forums
 New to SQL Server Programming
 delete a record

Author  Topic 

asm
Posting Yak Master

140 Posts

Posted - 2007-12-14 : 23:47:02
Hi,

How can i delete a record from a table . table contains approx 3 million data and when i execute a query for delete it give error message from transaction log space problem.
Is there any way to stop the log in transaction log and delete the record.


thanks

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-12-14 : 23:52:17
No, you can't stop logging. Let log file auto grow. If you want to delete all rows in the table, use truncate table statement instead.
Go to Top of Page

asm
Posting Yak Master

140 Posts

Posted - 2007-12-15 : 00:16:33
no, i want selected record should be deleted. tell how to define log file auto grow.
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-12-15 : 00:58:09
In db properties -> file tab in ssms.
Go to Top of Page

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2007-12-15 : 01:16:02
if you are keeping only a tiny fraction of a large table, you could do this:

1. bcp out the rows you want to keep.
2. truncate the table.
3. bulk insert the rows exported in step 1 back into the table.




elsasoft.org
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-12-15 : 01:43:37
or do it as bulk delete
http://www.thescripts.com/forum/thread171261.html

Madhivanan

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

- Advertisement -