Solved

SQL Server 2008 Rebuild Index Fails

Posted on 2014-01-28
1
1,539 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 500 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

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

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

After restoring a Microsoft SQL Server database (.bak) from backup or attaching .mdf file, you may run into "Error '15023' User or role already exists in the current database" when you use the "User Mapping" SQL Management Studio functionality to al…
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 video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

729 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