B
Bob Day
Using VS.2003, VB.net, MSDE...
Using Server Explorer, Design Table, to create a simply table with a
primary key and 1 column as below:
"Primary Key" as integer, autonumbered
"Primary_Key_String" as string
I want Primary_Key_String to be a string representation of Primary_Key. The
Primary_Key_String will be an index. The reason I want to use it as an
index is so it can be part of a covering index (a series of other string
columns used as indexes), so I can throw "%" in it when I don't care about
it.
Since Primary_Key is an autonumber column, I have put in the formula field
for Primay_Key_String "str(Primary_Key)". This works as expected, putting
the autonumber generated during an UPDATE in both Primary_Key and
Primary_Key_String. The problem is, when you try to create an index on
Primary_Key_String (using Server Explorer Design Table), since it is a
calculated field via a formula, it will not let you, thus making it
undersirable as an index.
Is there a way to create a string index of the autonumber Primary_Key? Is
there another approach?
Thanks!
Bob
Using Server Explorer, Design Table, to create a simply table with a
primary key and 1 column as below:
"Primary Key" as integer, autonumbered
"Primary_Key_String" as string
I want Primary_Key_String to be a string representation of Primary_Key. The
Primary_Key_String will be an index. The reason I want to use it as an
index is so it can be part of a covering index (a series of other string
columns used as indexes), so I can throw "%" in it when I don't care about
it.
Since Primary_Key is an autonumber column, I have put in the formula field
for Primay_Key_String "str(Primary_Key)". This works as expected, putting
the autonumber generated during an UPDATE in both Primary_Key and
Primary_Key_String. The problem is, when you try to create an index on
Primary_Key_String (using Server Explorer Design Table), since it is a
calculated field via a formula, it will not let you, thus making it
undersirable as an index.
Is there a way to create a string index of the autonumber Primary_Key? Is
there another approach?
Thanks!
Bob