Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Trouble Dropping Primary Key Expand / Collapse
Author
Message
Posted Tuesday, June 24, 2014 11:12 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Monday, September 29, 2014 10:57 PM
Points: 4,242, Visits: 4,290
I'm trying to DROP a Primary Key and it will not drop.

I check the percent_complete and it is stuck at zero percent.

Wait Type is primarily CXPACKET.


For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/

For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

Post #1585603
Posted Tuesday, June 24, 2014 11:21 AM
SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Yesterday @ 1:48 PM
Points: 4,053, Visits: 3,490
Did you drop your nonclustered indexes first?

For details on CXPACKET, Paul's blog on wait stats is at http://www.sqlskills.com/blogs/paul/wait-statistics-or-please-tell-me-where-it-hurts/.



Tally Tables - Performance Personified
String Splitting with True Performance
Best practices on how to ask questions
Post #1585609
Posted Tuesday, June 24, 2014 11:29 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Monday, September 29, 2014 10:57 PM
Points: 4,242, Visits: 4,290
Ed Wagner (6/24/2014)
Did you drop your nonclustered indexes first?

For details on CXPACKET, Paul's blog on wait stats is at http://www.sqlskills.com/blogs/paul/wait-statistics-or-please-tell-me-where-it-hurts/.


No, I've been bad.

Thanks.


For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/

For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

Post #1585613
Posted Tuesday, June 24, 2014 11:42 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Monday, September 29, 2014 10:57 PM
Points: 4,242, Visits: 4,290
I dropped the Non Clustered Index and it is in a suspended State and a PAGEIOLATCH_EX Wait Type.

Percent Complete steady at zero percent.


For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/

For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

Post #1585616
Posted Tuesday, June 24, 2014 12:05 PM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Monday, September 29, 2014 10:57 PM
Points: 4,242, Visits: 4,290
How about when you create the Indexes, what order do you use?

I'm changing the primary key from CLUSTERED to Non-Clustered.

I'm going to create a Clustered Index on columns that are being Sorted By and per the Execution Plan that is taking up 61%.

Recreating an existing Non Clustered.

Any feedback would be greatly appreciated


For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/

For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

Post #1585620
Posted Tuesday, June 24, 2014 12:17 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 3:48 AM
Points: 39,980, Visits: 36,345
Welsh Corgi (6/24/2014)
I dropped the Non Clustered Index and it is in a suspended State and a PAGEIOLATCH_EX Wait Type.

Percent Complete steady at zero percent.


Probably because it's waiting for the drop of the clustered index to complete. You should drop nonclustered indexes before dropping a cluster, not during.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1585623
Posted Tuesday, June 24, 2014 12:28 PM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Monday, September 29, 2014 10:57 PM
Points: 4,242, Visits: 4,290
ok, thanks.

I should have made a post earlier but I had a production issue.

I was able to Delete all Indexes and the Primary Key.

Now I'm having problems creating a Non CLUSTERED Index.


For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/

For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

Post #1585625
Posted Tuesday, June 24, 2014 12:38 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 3:59 PM
Points: 13,007, Visits: 12,426
Welsh Corgi (6/24/2014)

Now I'm having problems creating a Non CLUSTERED Index.


We can help but we need to know what the problem is.


_______________________________________________________________

Need help? Help us help you.

Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

Need to split a string? Try Jeff Moden's splitter.

Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
Post #1585628
Posted Tuesday, June 24, 2014 1:25 PM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Monday, September 29, 2014 10:57 PM
Points: 4,242, Visits: 4,290
Sean Lange (6/24/2014)
Welsh Corgi (6/24/2014)

Now I'm having problems creating a Non CLUSTERED Index.


We can help but we need to know what the problem is.


Sorry for not providing better details.

After dropping all of the Indexes and the Primary Key when I Execute a CREATE Index Statement last_wait is SLEEP_TASK and percent_complete remain at zero.


If I cancel it the percent_complete moves pretty quickly.

Other than my process there is barely any activity on the Server.

Thank you.


For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/

For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

Post #1585647
Posted Wednesday, June 25, 2014 8:16 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Monday, September 29, 2014 10:57 PM
Points: 4,242, Visits: 4,290
I ended up renaming the table and recreating it with the proper Indexes and loading the table.


For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/

For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

Post #1585917
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse