Advertisement

01.07.2008 at 03:09PM PST, ID: 23065120
[x]
Attachment Details

sql server drop clustered property but retain primary key in replicated table

Asked by frankytee in MS SQL Server, SQL Query Syntax, SQL Server 2005

Tags: key, primary, clustered, sql, server

platform: windows 2000 server
db:      sql server 2000

I have a big trend table (loan_trend) which holds 30 million records + and growing each end of month. this table is replicated so there are PK constraints.

the problem is the original developer added an identity field (autoID) to satisfy PK requirements for replication but also made it a clustered index. This autoID clustered PK has no benefit for the many stored procs on this table so i want to change the clustered index to appropriate fields in that table.

i want to be able to drop the clustered property of this PK but not drop the PK itself. i dont want to do this using the GUI as there are several other big tables involved and I dont want to sit there watching the hourglass cursor during the upgrade (there are many other indexes being changed, stored procs etc) so I need this scripted in transact sql.

Also what would be the impact on replication? can i just switch off the replication, make the changes in the tables in both the original production db and replicated db, then switch replication back on?

thanksStart Free Trial
 
 
[+][-]01.07.2008 at 03:38PM PST, ID: 20604406

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.07.2008 at 06:14PM PST, ID: 20605418

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]01.07.2008 at 07:51PM PST, ID: 20605835

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.08.2008 at 03:48AM PST, ID: 20607669

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: MS SQL Server, SQL Query Syntax, SQL Server 2005
Tags: key, primary, clustered, sql, server
Sign Up Now!
Solution Provided By: angelIII
Participating Experts: 3
Solution Grade: A
 
 
[+][-]01.08.2008 at 07:56AM PST, ID: 20609556

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628