Showing posts with label order. Show all posts
Showing posts with label order. Show all posts

Wednesday, March 7, 2012

Repairing indexes in a table but getting errors

Hi ALL,

Somehow one of tables in my database with clustered index got tempered and the pageid are not in proper order. I tried the checkdb command with repair_rebuild option but it is giving the following error.

Table error: Object ID 1984530649, index ID 1. Page (1:254682) is missing a reference from previous page (1:254681). Possible chain linkage problem.

Server: Msg 8936, Level 16, State 1, Line 1

Table error: Object ID 1984530649, index ID 1. B-tree chain linkage mismatch. (1:254680)->next = (1:256198), but (1:256198)->Prev = (1:256197).

Not able to reindex the index of table. I can not even export the data to any other table with same structure.

Please help me.........

Thanks,
PracheerPls take a look at
http://www.sql-server-performance.com/forum/topic.asp?TOPIC_ID=6046

:)|||Thanks for the help. I will try all the scenarios. Hope that will solve my problem.

:)

Saturday, February 25, 2012

Reorder the table definition of a SQL 2005 table

Hi,

Is it possible to reorder the table definition in a SQL 2005 table?

Example : i want to put to table definition in alphabetical order.

Thanks in advance

I dont understand. do you mean re-ordering of columns in the table?

|||

When i look at my table, i see that the columns are in this order :

CatId
SubCatId
ImageId
PhoneNumber
Adress
Fax
Cell

But if i want to have this order (alphabetical order) :

Adress
CatId
Cell
Fax
ImageId
PhoneNumber
SubCatId

How can i do that?

|||

The order of columns in a table does not matter. So does order of rows in a table.

You can always write your SELECT statement to return the rows in the column order you want.

SELECT Adress, CatId, Cell, Fax, ImageId, PhoneNumber, SubCatId

FROM YoutYable


|||

Ok but if i want to arrange the order of columns when i open the table with SQL Server Management Studio to see them in alphabetical order...

Can i do that?

|||

The bigger question is why? It is just a GUI thing.

|||

I know that!

It's just that i like my things to be ordered ;-)

So?

|||

Right click on the table --> Design view, you can drag the columns up or down.

|||

Ok Thanks!