|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Thursday, May 02, 2013 7:35 AM
Points: 1,140,
Visits: 933
|
|
|
|
|
|
SSCarpal Tunnel
       
Group: General Forum Members
Last Login: Today @ 3:22 AM
Points: 4,218,
Visits: 3,875
|
|
Ok, I got it right and I don't really want to complain about the question. In fact I think it's a pretty good question. But what I find strange is that the question is placed under the header SQL 2008 indexes, but the link in the answer refers to BOL for SQL 2005.
Markus Bohse
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Sunday, April 14, 2013 8:55 AM
Points: 1,383,
Visits: 1,212
|
|
I agree, this is a very good question, but there's something I can't figure out or find in a quick search: Why would you ever want to disable a primary key or other clustered index??
Does anyone know of use cases?
Thanks, Tao
http://poorsql.com for T-SQL formatting: free as in speech, free as in beer, free to run in SSMS or on your version control server - free however you want it.
|
|
|
|
|
SSC-Insane
         
Group: General Forum Members
Last Login: Yesterday @ 7:36 PM
Points: 21,357,
Visits: 9,535
|
|
| I don't know, maybe do a manual import and then delete the dupes??? That's not the way I'd do it, but who am I to say something on that subject ;).
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: Today @ 12:39 PM
Points: 3,397,
Visits: 3,405
|
|
| According to the guidelines, inserts will fail also. I agree, I am not sure why you would ever want to disable the clustered index. I can't come up with a sound reason.
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: Today @ 12:39 PM
Points: 3,397,
Visits: 3,405
|
|
| I guess it is a way to take the table offline while preparing to do something with it. That's all I can think of.
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Tuesday, May 14, 2013 4:39 PM
Points: 6,260,
Visits: 1,977
|
|
Actually I have had the need for this feature for a long time. Suppose you need to prevent changes on ONE table while you are doing some maintenance work in a Db. To Set a DB in read-only mode is too drastic, To Setup that table in a separated File and make it read only is inconvenient. To setup INSTEAD OF/AFTER TRIGGERS is expensive in Server resources.
This solution seems cheap and Fast ;)
* Noel
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: Today @ 12:39 PM
Points: 3,397,
Visits: 3,405
|
|
| Yes, that makes sense since there is no way to take a table offline like you can in Oracle.
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Sunday, April 14, 2013 8:55 AM
Points: 1,383,
Visits: 1,212
|
|
Thanks Noel, that makes sense - I'm not sure it's very "cheap" because the clustered index gets rebuilt when it gets re-enabled (according to the BOL article), but still seems better than the alternatives!
http://poorsql.com for T-SQL formatting: free as in speech, free as in beer, free to run in SSMS or on your version control server - free however you want it.
|
|
|
|
|
SSC-Insane
         
Group: General Forum Members
Last Login: Yesterday @ 7:36 PM
Points: 21,357,
Visits: 9,535
|
|
| I think I'd go with the instead of triggers... if it saves me a full clustered index rebuild.
|
|
|
|