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.
Author |
Topic |
Mondeo
Constraint Violating Yak Guru
287 Posts |
Posted - 2007-09-14 : 05:28:46
|
I have a table with about 10 million rows, its been logging data incorrectly and I want to start again.DELETE FROM tblLogI just get a message about the server timing out, what can I do?Thanks |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-09-14 : 05:31:47
|
If you want to delete all rows then try truncationTruncate table tblLogMadhivananFailing to plan is Planning to fail |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-09-14 : 05:32:07
|
E 12°55'05.25"N 56°04'39.16" |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-09-14 : 05:37:46
|
If you cant delete then do batch deletiondeclare @rows intset @rows=10000while @rows>0begin set rowcount 10000 delete from tblLog set @rows=@@rowcount set rowcount 0end MadhivananFailing to plan is Planning to fail |
|
|
Kristen
Test
22859 Posts |
Posted - 2007-09-14 : 05:40:53
|
I think even that may cause timeouts Madhi. Thedelete from tblLogis liable to make a working list, and then take the 10,000 rows from that. (Actually without any WHERE clause it will probably just start-in using any Clustered Index ... but if no CI available, or a Where clause required, then I think a more complex solution is called for (which I think is discussed in the link Peso posted)Kristen |
|
|
|
|
|