Tuesday, March 27, 2012

Alternate Key (from good 'ole ISAM file days)

In an ISAM file, you can have a primary key and alternate keys.
In a SQLServer database, you can have a primary key and foreign keys
attached to other tables.
Pardon my ignorance, but is it possible to identify a field in a table as an
alternate lookup? For example, empid is the primary and emplastname would be
an alternate.
--
EdYou can set up additional indexes on your tables. Since your Primary Key is
most likely clustered, these additional indexes will have to be
non-clustered. A good starting point might be to look at which queries are
run the most, and which ones are taking the most time, and index the columns
used in the WHERE clauses of those queries.
"Ed" <Ed@.discussions.microsoft.com> wrote in message
news:0C0B6107-E67E-4847-BBB0-0DD247DEACC6@.microsoft.com...
> In an ISAM file, you can have a primary key and alternate keys.
> In a SQLServer database, you can have a primary key and foreign keys
> attached to other tables.
> Pardon my ignorance, but is it possible to identify a field in a table as
> an
> alternate lookup? For example, empid is the primary and emplastname would
> be
> an alternate.
> --
> Ed|||In a relational database, the term alternate key implies unique values.
Unique constraints are usually defined on alternate keys.
It looks like what you want is an index. You can add an index on your
emplastname column to improve performance.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Ed" <Ed@.discussions.microsoft.com> wrote in message
news:0C0B6107-E67E-4847-BBB0-0DD247DEACC6@.microsoft.com...
> In an ISAM file, you can have a primary key and alternate keys.
> In a SQLServer database, you can have a primary key and foreign keys
> attached to other tables.
> Pardon my ignorance, but is it possible to identify a field in a table as
> an
> alternate lookup? For example, empid is the primary and emplastname would
> be
> an alternate.
> --
> Edsql

No comments:

Post a Comment