Sunday, February 19, 2012

index and key

What is the difference between key and index? Thanks.Keys are business rules which help to provide data integrity. Major keys in
RDBMS are Primary key and Foreign Key.
Where as Index is an object which helps to find data in a table quickly with
out scanning the entire table.
Thanks
Hari
SQL Server MVP.
"00KobeBrian" <a@.b.com> wrote in message
news:%23zNFTLMxGHA.1296@.TK2MSFTNGP02.phx.gbl...
> What is the difference between key and index? Thanks.
>|||An index is a structure that helps a database find a particular value
quickly. A key is the value that the index is built to find. For example,
if you build an index on the employees table with a key of the social
security number, the index will allow the database to find employee rows
quickly based on the social security number.
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"00KobeBrian" <a@.b.com> wrote in message
news:%23zNFTLMxGHA.1296@.TK2MSFTNGP02.phx.gbl...
> What is the difference between key and index? Thanks.
>|||Hi ,
Exactly as Hari said, index is a structure associated with a table or view
that speeds retrieval of rows from the table or view. An index contains
keys built from one or more columns in the table or view. These keys are
stored in a structure that allows SQL Server to find the row or rows
associated with the key values quickly and efficiently.
Thanks.
Best regards,
Vincent Xu
Microsoft Online Partner Support
========================================
==============
Get Secure! - www.microsoft.com/security
========================================
==============
When responding to posts, please "Reply to Group" via your newsreader so
that others
may learn and benefit from this issue.
========================================
==============
This posting is provided "AS IS" with no warranties,and confers no rights.
========================================
==============
--[vbcol=seagreen]
in[vbcol=seagreen]
with[vbcol=seagreen]

No comments:

Post a Comment