Hej everybody,

problem : I'm searching for proper way to transform a catalog from clustered to non-clustered

Description : I've got a table as below in sybase db:

dbo.UserLog
------------------------
Id | UserId |time | ....
------------------------

This really is hash partitioned using UserId.

Presently it's 2 indexes

UserId : non-clustered
time: clustered

This table has about 20 million records.

I would now like to make UserId as clustered index and time as non-clustered index.

could it be correct to user alter index to alter from clustered to non-clustered or will i drop index and recreate. does the truth that userId can be used in hash partitioning have implications for this?

In my experience alter appears approach to take however i haven't yet attempted this.

Just drop both after which recreate them how you would like them. As you are doing this type of major switch to each index, I am sure the DB engine is simply shedding and creating them advertising media are the alter anyway. If you're concerned about the the fact that userId is used in hash partitioning then creating each index new would appear the most secure in my experience, but I am sure Sybase won't screw up if you are using alter.