?
Solved

When changing key columns in an nonclustered or clustered index should I always use DROP_EXISTSING?

Posted on 2011-04-27
3
Medium Priority
?
239 Views
Last Modified: 2012-05-11
When changing key columns in an nonclustered or clustered index should I always use DROP_EXISTSING?
0
Comment
Question by:Mr_Shaw
3 Comments
 
LVL 9

Accepted Solution

by:
kaminda earned 1000 total points
ID: 35473976
You can use alter index to change the index columns

i.e

USE AdventureWorks2008R2;
GO
ALTER INDEX PK_Employee_BusinessEntityID ON HumanResources.Employee
REBUILD;
GO

http://technet.microsoft.com/en-us/library/ms188388.aspx
0
 
LVL 9

Assisted Solution

by:radcaesar
radcaesar earned 1000 total points
ID: 35475472
USe ALTER INDEX.

You need not use DROP INDEX, the SQL Server will internally use this. So the answer is YES.
0
 

Author Closing Comment

by:Mr_Shaw
ID: 35476719
thanks
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
This shares a stored procedure to retrieve permissions for a given user on the current database or across all databases on a server.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Suggested Courses

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question