[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

SQL Server 2008 Rebuild Index Fails

Posted on 2014-01-28
1
Medium Priority
?
1,641 Views
Last Modified: 2014-01-28
Hi everyone,

I have a major problem with my SQL Server 2008 maintenance plan.

I have a huge database (40 Go) that need to be re-indexed every day.
Since four days, I have the following error :

******************
Code: 0xC0024104    
Source: Rebuild Index      
Description: The Execute method on the task returned error code 0x80004002 (Unable to cast object of type 'System.DBNull' to type 'System.String'.). The Execute method must succeed, and indicate the result using an "out" parameter.  End Error  DTExec: The package execution returned DTSER_FAILURE (1).
******************

I made some searches on the web but found nothing.

Can you help me or get a hint on what to check to make this work again?

Thank you
0
Comment
Question by:luminis86
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 16

Accepted Solution

by:
Surendra Nath earned 2000 total points
ID: 39816390
Step 1:
Use the below code to generate the reorganize script

Select 'Alter Index All on ' + name + ' REORGANIZE ; ' From sys.tables

Open in new window


once this code is executed you will get a set of alter statments in your SSMS query result windows copy them back into the query window and execute them.

If there is an error for a particular table, then that table is the culprit when reorganizing is done -- Go to step 3 then,

If the reorganize gets done succesfully.

Then run the below code

Select 'ALTER INDEX ALL ON ' + name + ' REBUILD WITH (FILLFACTOR = 80, SORT_IN_TEMPDB = ON,STATISTICS_NORECOMPUTE = ON); ' From sys.tables

Open in new window



once this code is executed you will get a set of alter statments in your SSMS query result windows copy them back into the query window and execute them.

If there is an error for a particular table, then that table is the culprit when rebuilding is done -- Go to step 3 then,


Step 3

Try to do drop the indexes and recreate them here... they will solve the isssue completly.


Step 4
If you didn't find the issue at all with step1 and step2 then try running DBCC CHECKDB and re-run the maintance plan.
0

Featured Post

What’s Wrong with Your Cloud Strategy ?

Even as many CIOs are embracing a cloud-first strategy, the reality is that moving to the cloud is a lengthy process and the end-state is likely to be a blend of multiple clouds—public and private. Learn why multicloud solutions matter in this webinar by Nimble Storage.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question