Solved

not able to rearrange the columns if it had the ALTER TABLE INDEX

Posted on 2014-07-31
2
136 Views
Last Modified: 2014-08-07
when a table has the below kind of index (with a WHERE), then it does not allow me to rearrange the order of columns, unless i drop the index first. is there a way to disable this need?

CREATE UNIQUE NONCLUSTERED INDEX ix_abc
 ON tablename (Columname) WHERE Columname IS NOT NULL
0
Comment
Question by:25112
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 21

Expert Comment

by:Randy Poole
ID: 40231928
why do you care what order the columns are in?
0
 
LVL 69

Accepted Solution

by:
Scott Pletcher earned 500 total points
ID: 40232075
SQL does not have a direct method of adding a column in a given location in the table.  SSMS (SQL's gui) adds a column in a given location, but it does it by copying the data out, recreating the table (essentially), and copying the data back in.  Given that, yes, there are index restrictions, but you're much better off dropping such indexes before that and re-creating them afterward anyway with all that data copying going on.
0

Featured Post

Comparison of Amazon Drive, Google Drive, OneDrive

What is Best for Backup: Amazon Drive, Google Drive or MS OneDrive? In this free whitepaper we look at their performance, pricing, and platform availability to help you decide which cloud drive is right for your situation. Download and read the results of our testing for free!

Question has a verified solution.

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

After restoring a Microsoft SQL Server database (.bak) from backup or attaching .mdf file, you may run into "Error '15023' User or role already exists in the current database" when you use the "User Mapping" SQL Management Studio functionality to al…
There have been several questions about Large Transaction Log Files in SQL Server 2008, and how to get rid of them when disk space has become critical. This article will explain how to disable full recovery and implement simple recovery that carries…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

726 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