> Hi
>
> Help Please,
>
> I have the following index:
>
> ALLTRIM(TTOC(sdatetime)+ALLTRIM(phone)+ALLTRIM(STR(id1))+ALLTRIM(STR(id2)))
>
> When I try to populate the table (alias), I get error message:"Error building key for index..."
>
> Tnx
Chaim,
You have alltrim() in your index expression which is useless for indexes and make a non-fixed size index. If alltrim is a must:
cast( ALLTRIM(TTOC(sdatetime)+ALLTRIM(phone)+ALLTRIM(STR(id1))+ALLTRIM(STR(id2))) as c(50))
to fix the size. Now to your key. It looks very weird and useless to me (I may be wrong). I don't have an idea why would you need such a combined index for but considering you have a reason can't you build something more appropriate like:
TTOC(sdatetime,1)+phone+STR(id1)+STR(id2)
Cetin Basoz
.Net has got better.Think about moving - check my blog:
Blog (main)Blog (mirror)