473,508 Members | 2,425 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Index on field length

balabaster
797 Recognized Expert Contributor
Does anyone know if it's possible to create an index based on the length of a field in a table?
Jul 7 '08 #1
4 2116
debasisdas
8,127 Recognized Expert Expert
try to create function based index.
Jul 8 '08 #2
balabaster
797 Recognized Expert Contributor
try to create function based index.
Is that possible in SQL Server? I couldn't find a way to make it work. In the end, I created some extra calculated fields and indexed those.
Jul 8 '08 #3
debasisdas
8,127 Recognized Expert Expert
Is that possible in SQL Server? I couldn't find a way to make it work. In the end, I created some extra calculated fields and indexed those.
since sql server does not suppor that type of index you need to use some workaround to create an extra field and index that . you can always populate that field using some trigger.
Jul 8 '08 #4
balabaster
797 Recognized Expert Contributor
since sql server does not suppor that type of index you need to use some workaround to create an extra field and index that . you can always populate that field using some trigger.
The fields I created are actually calculated, which I suppose in some sense work like a trigger... I may change them so they're updated by a trigger instead of being calculated which theoretically could improve query performance for selects as the calculation wouldn't need to be performed on each row as they are queried.
Jul 8 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

4
2003
by: Bruce D | last post by:
I have a table, table1, with the field 'areacodeplustelephone'. This field is of length 10. I created an index called 'areacode' that only uses the first three characters. Can I use this index...
6
22404
by: Bill | last post by:
In an effort to improve the speed of queries against my main table, I'll be indexing a column whose data type is varchar(50). Would I be better off (better performance) if I changed the column's...
5
4690
by: Mike | last post by:
I'm using a script provided by e-mailanywhere, it's a little too big for me. There's 1 text field and 1 password field in a form. OnSubmit, I would like both fields to be validated to look for...
2
2340
by: Miss Livvy | last post by:
Would it be OK to use varchar(5) instead of char(5) as the first field of a composite clustered index? My gut tells me that varchar would be a bad idea, but I am not finding much information on...
8
2113
by: John Baima | last post by:
I have an Access table that just consists of 2 columns: WordID (Autonumber, Primary key) and WordText (Text, Indexed, No dups). I've used this with a number of texts and languages without any...
4
3590
by: Antoine | last post by:
Herfried and Cor:- I used tracing and actually tracked down the code that was causing the problem most likely. I wonder if you wanted to comment on it. Also I wonder if there is a better way...
2
1872
by: Martin v. Löwis | last post by:
I've been working on PEP 353 for some time now. Please comment, in particular if you are using 64-bit systems. Regards, Martin PEP: 353 Title: Using ssize_t as the index type Version:...
7
2896
by: Cyberwolf | last post by:
Is there a way to set a primary index to ignore Nulls and if so how would I do it. I have already tried setting it so it is not a required field, but that does not work. It states that the field...
6
6212
by: john | last post by:
Last week I posted about making a unique index on multiple fields to prevent importing identical records twice. I still have trouble with the nulls in the index. The only way that I can make it...
0
7224
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7118
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7323
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7493
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5625
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5049
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4706
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3192
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.