New answers tagged

2

Another workaround for this problem is to use set based logic, replacing the CASE expression with a left join (or outer apply) to a reference table (ref in code below), which can be either permanent, temporary or a derived table / CTE. If this is needed in multiple queries and procedures, I'd prefer to have this as permanent table: SELECT ref.result_column ...


-4

one way to get around this is to include the test in the when clause i.e. case when SUBSTRING(p.Name, 1, 1) = 'a' THEN '1' ...


6

To add to the answer above, if you're on Enterprise Edition, where a normal DBCC CHECKDB will run in parallel, when you run with a repair option it must run single-thread, so it will also take more time. Any DBCC CHECK* command has to scan all the data as the results from any previous DBCC CHECK* command are not persisted anywhere in no way can be ...


5

will it need to take the same amount of time to scan for errors Yes it has to do it again .. scan and fix the errors with potential data loss. Be cautious, use it as a last resort - repair & allow data loss ! Refer : Corruption .. Last resorts that people try first… from Paul Randal. Remember : SQL Server 2000 is out of support .. so microsoft is ...



Top 50 recent answers are included