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 |
thomasgeorgem
Starting Member
4 Posts |
Posted - 2010-05-19 : 04:13:01
|
Hi,I have SQL Server 2000 Enterprise with SP4. I have a table with a composite primary key of 4 fields including one datetime field. The error occurs when I am trying a delete based on the date field. The statement is as follows:delete from table_trans_log where CONVERT(DATETIME,convert(varchar,logDatetime,101))<='05/12/2009'it works smoothly if equal to operator is used as below:delete from table_trans_log where CONVERT(DATETIME,convert(varchar,logDatetime,101))='05/12/2009'can anybody help please ?Thanks in advanceThomas |
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2010-05-19 : 09:17:58
|
Sounds like database corruption. Please run (or ask your DBA to run) the following and post the full and complete output here.Do you know when this started? Do you have a clean backup of this database? (A backup that doesn't have this problem)--Gail ShawSQL Server MVP |
|
|
thomasgeorgem
Starting Member
4 Posts |
Posted - 2010-05-20 : 09:50:00
|
Thank you Gail. We dont know exactly at which point the problem started. We have a clean database backup.I think you expect me to run a script. Please post it.Thomas |
|
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2010-05-20 : 10:03:04
|
Sorry.DBCC CHECKDB (<Database Name>) WITH NO_INFOMSGS, ALL_ERRORMSGS How can you be sure that you have a clean backup if you don't know when the problem started?--Gail ShawSQL Server MVP |
|
|
thomasgeorgem
Starting Member
4 Posts |
Posted - 2010-05-20 : 10:35:13
|
Server: Msg 2511, Level 16, State 2, Line 1Table error: Object ID 1173579219, Index ID 0. Keys out of order on page (1:18308), slots 63 and 64.CHECKDB found 0 allocation errors and 1 consistency errors in table 'Table_Trans_Log' (object ID 1173579219).CHECKDB found 0 allocation errors and 1 consistency errors in database 'BravoLFS'.repair_rebuild is the minimum repair level for the errors found by DBCC CHECKDB (BravoLFS ).Regarding when it started, i mean the exact point of time / process .But we know it which day. Hence the clean backup means previous days backup.thanks, Thomas |
|
|
paulrandal
Yak with Vast SQL Skills
899 Posts |
Posted - 2010-05-20 : 14:24:15
|
There have been some bugs around parallel index rebuilds and data modifications in 2000, including some affecting SP4.See if http://support.microsoft.com/kb/929440 applies to you. [edit by tkizer to fix the url]Rebuilding the clustered index on table_trans_log should fix this problem (better doing it manually rather than through CHECKDB, as that will require the database to be single_user for the duration).ThanksPaul S. Randal,CEO, SQLskills.com Blog: www.SQLskills.com/blogs/paul Twitter: twitter.com/PaulRandalSQL MVP, Microsoft RD, Contributing Editor of TechNet and SQL Server MagazinesAuthor of SQL 2005 DBCC CHECKDB/repair code |
|
|
thomasgeorgem
Starting Member
4 Posts |
Posted - 2010-05-22 : 04:45:18
|
Hi Paul,It worked. I just rebuilt the index manually.thanks a lot.Thomas |
|
|
|
|
|
|
|