forum.venkateswarlu.net
      Register      Login
Can i create Clustered and non clustered index in same field?

5 replies to this topic

Dhirendra Prajapati #1
Member
34 Points
Posted on 17 Mar 2012 01:51 PM IST Can i create Clustered and non clustered index in same field? 
SQL Server     729 views     Reply to this topic
Harikrishna Sikhakolli #2
Member
108 Points
Replied on 21 Mar 2012 06:04 AM IST we can create both clustered and non clustered indexes on same field. 
Reply to this topic
Dhirendra Prajapati #3
Member
34 Points
Replied on 21 Mar 2012 06:20 AM IST Hi,
Thnx for reply.

but which index will used when using this field.
means clustered index worked or nonclustered index worked. 
Reply to this topic
Dhirendra Prajapati #4
Member
34 Points
Replied on 21 Mar 2012 06:20 AM IST Hi,
Thnx for reply.

but which index will used when using this field.
means clustered index worked or nonclustered index worked. 
Reply to this topic
Harikrishna Sikhakolli #5
Member
108 Points
Replied on 23 Mar 2012 05:05 AM IST Generally clustered index existed on the table the data inserted in the ordered manner into the table.
when non-clusterd index is existed on the table the date inserted in the table as like we can insert.
clusterd:-
1 hari hyd
2 krishna che
insert into emp values(4,'anjaneyulu','mum'),(3,'vasu','ban')
output:-
id name loc
1 hari hyd
2 krishna che
3 vasu ban
4 anjaneyulu mum

non clustered:-
id name loc
1 hari hyd
2 krishna che
insert into emp values(4,'anjaneyulu','mum'),(3,'vasu','ban')
output:-
id name loc
1 hari hyd
2 krishna che
4 anjaneyulu mum
3 vasu ban
clustered index worked.first create clustered and non clustered indexes on the same field
of the table
Ex:-
table :emp
id name loc
1 hari hyd
2 krishna che
insert into emp values(4,'anjaneyulu','mum'),(3,'vasu','ban')
output:-
id name loc
1 hari hyd
2 krishna che
3 vasu ban
4 anjaneyulu mum

so clustered index is worked.
 
Reply to this topic
Dhirendra Prajapati #6
Member
34 Points
Replied on 23 Mar 2012 05:41 AM IST thnx sir!!! 
Reply to this topic