Results 1 to 4 of 4

Thread: can you say what is the use of index in SQL server 2000?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2007
    Posts
    167

    can you say what is the use of index in SQL server 2000?

    Hi,
    could u pls illustrate what is the use of creating index in Sql Server 2000? Is it used to create a unique key for each row in a table ? or is there any other special reason for that?

    I tried an example by seeing help. the index is starting from 1. can't i start the index from my desired value like 1000?

    The question what i am posting may be silly one, but really i don't know. please help me if u know it.

    Thanks & regards,
    raghunadhs

  2. #2
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: can you say what is the use of index in SQL server 2000?

    Indexes serve many purposes.

    A primary key index is almost required in order to have some unique field in which to identify one single row. If a column already in the table cannot be used for this purpose sometimes it makes sense to create an identity column - where the key value is automatically assigned when rows are added. You can create this identity rule for your primary key to start at any value and increment by any value for subsequent adds.

    Other alternate key indexes can be added to a table as well. Sometimes to force uniqueness - but not always...

    We put many alternate key indexes on table columns because those columns are used in JOIN's to other tables when we write queries. This speeds up the JOIN operation.

    Indexes on a column allow for the "fastest" possible "finding" of a value in that column.

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: can you say what is the use of index in SQL server 2000?

    Quote Originally Posted by szlamany
    We put many alternate key indexes on table columns because those columns are used in JOIN's to other tables when we write queries. This speeds up the JOIN operation.

    Indexes on a column allow for the "fastest" possible "finding" of a value in that column.
    I'm sure the other reasons szlamany mentioned are near and dear to the heart of a DBA, however, these two are the ones that are near and dear to a programmer!

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    May 2007
    Posts
    167

    Re: can you say what is the use of index in SQL server 2000?

    Hi szlamany,
    Really it is a good explenation. Thank you very much.
    regards,
    raghunadhs

    [QUOTE=szlamany]Indexes serve many purposes.

    A primary key index is almost required in order to have some unique field in which to identify one single row. If a column already in the table cannot be used for this purpose sometimes it makes sense to create an identity column - where the key value is automatically assigned when rows are added. You can create this identity rule for your primary key to start at any value and increment by any value for subsequent adds.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width