Is it possible to disable all clustered indexes?
We looked at your script and found out that in your script of disabling indexes, you have only included selected non-clustered index during the bulk insert and missed to disabled all the clustered index. Our DBA [name removed] has changed your script a bit and included all the clustered indexes. Since then our application is not working.
How to insert into a table with a clustered index?
You can optimize an INSERT statement into a table with a clustered index, by using a minimally-logged INSERT, but that’s out of scope for this question. Updated 2011-11-02: As Mark Smith has shown, INSERT s into a table with a clustered index might not always require to be sorted — the ORDER BY clause is also redundant in that case, though.
When to use clustered index key in SQL Server?
One notable example is when inserting a large number of rows into a table with a newsequentialid clustered index key. In versions of SQL Server prior to Denali SQL Server adds an unnecessary and potentially expensive sort operation. This can be avoided by
How to disable indexes and constraints in SQL Server?
Click the plus sign to expand the Indexes folder. Right-click the index you want to disable and select Disable. In the Disable Indexes dialog box, verify that the correct index is in the Indexes to disable grid and click OK.
What happens when you disable unique index in SQL Server?
A disabled index can be dropped. When disabling a unique index, the PRIMARY KEY or UNIQUE constraint and all FOREIGN KEY constraints that reference the indexed columns from other tables are also disabled. When disabling a clustered index, all incoming and outgoing FOREIGN KEY constraints on the underlying table are also disabled.
Can you create an index with the same name as an existing disabled index?
You cannot create an index that uses the same name as an existing disabled index. A disabled index can be dropped. When disabling a unique index, the PRIMARY KEY or UNIQUE constraint and all FOREIGN KEY constraints that reference the indexed columns from other tables are also disabled.