.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Interview Question >> Sql Server >> Post New Question Subscribe to Interview Questions

how many clustered and non-clustered index can a table have

Posted By :parthiban     Posted Date :July 27, 2010    Points :10   Category :Sql Server 
In SQL 2005 and earlier there was a limitation of 250 indexes per table, one clustered and 249 non-clustered. In SqL 2008, with the addition of filtered indexes, that limitation was increased to 1000, one clustered and 999 non-clustered indexes.

You can also find related Interview Question to how many clustered and non-clustered index can a table have  below: 

What will you do if you need to create clustered index on more than one field? Is it possible?

  
The answer is yes and no.
You can create clustered index only one clustered index in table.
Either you can create index on entire table or you can create clustered index on a view covering entire table.
Suppose, you have created table with following:
CREATE TABLE [dbo].[Table1](
[field1] [int] IDENTITY(1,1) NOT NULL,
[field2] [nchar](10) ,
[field3] [nchar](10) ,
[field4] [nchar](10)
) ON [PRIMARY]
Create index on entire table:
CREATE INDEX idx_coverTable ON Table1(field1, field2) INCLUDE (field3, field4)
Create clustered index on a view covering entire table:
CREATE VIEW v1111 with SCHEMABINDING
AS
SELECT field1, field2, field3, field4 FROM dbo.Table1
GO
CREATE UNIQUE CLUSTERED INDEX idx_viewClustered ON dbo.v1111(field1, field2, field3, field4)
GO (More...)

What is the basic difference between clustered and a non-clustered index

  
The difference is that, Clustered index is unique for any given table and we can have only one clustered index on a table. The leaf level of a clustered index is the actual data and the data is resorted in case of clustered index. Whereas in case of non-clustered index the leaf level is actually a pointer to the data in rows so we can have as many non-clustered indexes as we can on the db. (More...)

What's the difference between a clustered and a non-clustered index

  
clustered index directly affects the way tabled data is stored on a specific disk. This means that when a clustered index is used, data is stored in sequential rows based on the index column value. This is why a table can only contain a single clustered index. Non-clustered indexes directly affect the way physical data is stored and managed within SQL Server. (More...)

What's the difference between a clustered and a non-clustered index

  
A clustered index directly affects the way tabled data is stored on a specific disk. This means that when a clustered index is used, data is stored in sequential rows based on the index column value. This is why a table can only contain a single clustered index. Non-clustered indexes directly affect the way physical data is stored and managed within SQL Server. (More...)

How To Know Which Index A Table Is Using?

  
SELECT table_name,index_name FROM user_constraints (More...)

What is a table called, if it does not have neither Cluster nor Non-cluster Index? What is it used for?

  
Unindexed table or Heap. Microsoft Press Books and Book On Line (BOL) refers it as Heap.
A heap is a table that does not have a clustered index and, therefore, the pages are not linked by
pointers. The IAM pages are the only structures that link the pages in a table together.
Unindexed tables are good for fast storing of data. Many times it is better to drop all indexes from table and than do bulk of inserts and to restore those indexes after that. (More...)

What are the index combination's a table can have?

  
? Indexes
? A clustered index
? A clustered index and many nonclustered indexes
? A nonclustered index
? Many nonclustered indexes
(More...)

What are the different index configurations a table can have?

  
A table can have one of the following index configurations:

No indexes
A clustered index
A clustered index and many nonclustered indexes
A nonclustered index
Many nonclustered indexes (More...)

What is a Index?

  
To execute the Quesry faster (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

 
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.


Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend