Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2008
»
SQL Server 2008 - General
»
index legth
index legth
Rate Topic
Display Mode
Topic Options
Author
Message
bruce-347665
bruce-347665
Posted Thursday, December 13, 2012 6:25 AM
Forum Newbie
Group: General Forum Members
Last Login: Yesterday @ 5:08 AM
Points: 9,
Visits: 126
let say that we have a varchar(100) column and a index on that column
in mysql I can set the index length to any number smaller than 100.. if I set the index length to 5 then the index will consider only first 5 characters from each row
Can I set same thing in MSSQL? How?
Post #1396155
Koen Verbeeck
Koen Verbeeck
Posted Thursday, December 13, 2012 6:31 AM
SSCrazy Eights
Group: General Forum Members
Last Login: Yesterday @ 9:06 AM
Points: 9,367,
Visits: 6,465
As far as I know this isn't possible in SQL Server.
You could create a computed column that takes the first 5 characters of your column and put an index on the computed column.
Indexes on Computed Columns
How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?
Member of
LinkedIn
. My blog at
LessThanDot
.
MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1396157
demonfox
demonfox
Posted Thursday, December 13, 2012 6:31 AM
Ten Centuries
Group: General Forum Members
Last Login: Saturday, May 18, 2013 6:46 PM
Points: 1,074,
Visits: 1,076
bruce-347665 (12/13/2012)
let say that we have a varchar(100) column and a index on that column
in mysql I can set the index length to any number smaller than 100.. if I set the index length to 5 then the index will consider only first 5 characters from each row
Can I set same thing in MSSQL? How?
I don't think there is any index length set up in sql server; it is handled internally by sql server engine.
~ demonfox
___________________________________________________________________
Wondering what I would do next , when I am done with this one
Post #1396158
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.