SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Index Fragmentation


Index Fragmentation

Author
Message
sgovoni
sgovoni
SSC-Addicted
SSC-Addicted (412 reputation)SSC-Addicted (412 reputation)SSC-Addicted (412 reputation)SSC-Addicted (412 reputation)SSC-Addicted (412 reputation)SSC-Addicted (412 reputation)SSC-Addicted (412 reputation)SSC-Addicted (412 reputation)

Group: General Forum Members
Points: 412 Visits: 194
Comments posted to this topic are about the item Index Fragmentation
Dirk.Hondong
Dirk.Hondong
SSC-Addicted
SSC-Addicted (428 reputation)SSC-Addicted (428 reputation)SSC-Addicted (428 reputation)SSC-Addicted (428 reputation)SSC-Addicted (428 reputation)SSC-Addicted (428 reputation)SSC-Addicted (428 reputation)SSC-Addicted (428 reputation)

Group: General Forum Members
Points: 428 Visits: 1141
Hi all,

I´ve tried to create the procedure but I got an error during the parsing process.
Msg 170, Level 15, State 1, Procedure USP_ExecReorgRebuildIndex, Line 48
Line 48: Incorrect syntax near '('.

I have no idea where the error can be, maybe I´m blind.

If someone has an idea, please give me a hint.

Best regards,
Dirk


/EDIT
Forget it, it was all my fault. I´ve connected to the wrong database engine and parsed the command against SQL 2000

--
May you never suffer the sentiment of spending a day without any purpose.
@DirkHondong on Twitter
Abhijit More
Abhijit More
SSCrazy
SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)

Group: General Forum Members
Points: 2797 Visits: 767
Can you post the sample code. so dat it will be more easy to tell you the error.

the error is because of braces u are using. R u creating the dynamic SP or simple SP

Abhijit - http://abhijitmore.wordpress.com
Dirk.Hondong
Dirk.Hondong
SSC-Addicted
SSC-Addicted (428 reputation)SSC-Addicted (428 reputation)SSC-Addicted (428 reputation)SSC-Addicted (428 reputation)SSC-Addicted (428 reputation)SSC-Addicted (428 reputation)SSC-Addicted (428 reputation)SSC-Addicted (428 reputation)

Group: General Forum Members
Points: 428 Visits: 1141
Hi,

thanks for the reply.
I just took the code from here, as it is.
http://www.sqlservercentral.com/scripts/SQL+Server+2005/63287/

--
May you never suffer the sentiment of spending a day without any purpose.
@DirkHondong on Twitter
sgovoni
sgovoni
SSC-Addicted
SSC-Addicted (412 reputation)SSC-Addicted (412 reputation)SSC-Addicted (412 reputation)SSC-Addicted (412 reputation)SSC-Addicted (412 reputation)SSC-Addicted (412 reputation)SSC-Addicted (412 reputation)SSC-Addicted (412 reputation)

Group: General Forum Members
Points: 412 Visits: 194
Hi Dirk,

which version of SQL Server are you using ?

This script uses the DMV sys.dm_db_index_physical_stats usable only by the 2005 version of SQL Server.

To defragment indexes with SQL Server 2000 you can use this script (for the moment in Italian language, also released a brief translation in English).

Thanks.

Sergio
Dirk.Hondong
Dirk.Hondong
SSC-Addicted
SSC-Addicted (428 reputation)SSC-Addicted (428 reputation)SSC-Addicted (428 reputation)SSC-Addicted (428 reputation)SSC-Addicted (428 reputation)SSC-Addicted (428 reputation)SSC-Addicted (428 reputation)SSC-Addicted (428 reputation)

Group: General Forum Members
Points: 428 Visits: 1141
Hello Sergio,

thanks for the reply.
In our company environment we´re using SQL 2000 and 2005 servers.
So both scripts will be useful.
I think, I will try both after my 2 week holidays. Smile

Best regards
Dirk

--
May you never suffer the sentiment of spending a day without any purpose.
@DirkHondong on Twitter
sgovoni
sgovoni
SSC-Addicted
SSC-Addicted (412 reputation)SSC-Addicted (412 reputation)SSC-Addicted (412 reputation)SSC-Addicted (412 reputation)SSC-Addicted (412 reputation)SSC-Addicted (412 reputation)SSC-Addicted (412 reputation)SSC-Addicted (412 reputation)

Group: General Forum Members
Points: 412 Visits: 194
OK, and happy holidays Smile .

Sergio
Mark-82375
Mark-82375
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 Visits: 89
I've created this sp but when I run it with the print option I get no returns. I've already separately identified an index or 2 that are fragmented past 20% but don't show up, even though I've set my threshold at 10. Any ideas?



sgovoni
sgovoni
SSC-Addicted
SSC-Addicted (412 reputation)SSC-Addicted (412 reputation)SSC-Addicted (412 reputation)SSC-Addicted (412 reputation)SSC-Addicted (412 reputation)SSC-Addicted (412 reputation)SSC-Addicted (412 reputation)SSC-Addicted (412 reputation)

Group: General Forum Members
Points: 412 Visits: 194
Hello wthigo,

before executing the stored procedures you've connected to the database ?

For example:

USE TestDB

EXEC USP_ExecReorgRebuildIndex 'TestDB', 0, -1, 10


Bye

Sergio
alexander.oechsle
alexander.oechsle
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1086 Visits: 227
Hello,

Do you really need UPDATE STATISTICS when executing REBUILD?

I thought that this will be executed automatically by the rebuild.

Best regards,
Alex
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search