Click here to Skip to main content
15,890,186 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Can we have Clustered and non clustered index on String data type column?

What I have tried:

I am not sure whether we can use index on string. I guess yes we can but though not confident.
Posted
Updated 20-Apr-21 1:19am

Yes you can, however few things to keep in mind
- Do you actually benefit for ordering the rows based on varchar data as clustered index does
- If the column updated often, consider not using a clustered index since some 'reordering' is needed if the content of the column changes
- Index for a varchar isn't a good option if you need to search from the middle of the string. It can help if you search with an exact match or from the beginning of the column (COLUMN LIKE 'Some value%')
 
Share this answer
 
Sure, We can create clustred and non clustred index in strings data type.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900