?
Solved

SQL Server 2008 Rebuild Index Fails

Posted on 2014-01-28
1
Medium Priority
?
1,582 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

There have been several questions about Large Transaction Log Files in SQL Server 2008, and how to get rid of them when disk space has become critical. This article will explain how to disable full recovery and implement simple recovery that carries…
In this article I will describe the Detach & Attach 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.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

752 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