Results 1 to 3 of 3

Thread: indexes

  1. #1
    Join Date
    May 2004
    Posts
    21

    Question Unanswered: indexes

    proc1 has create table #a( id int) statement and create index ind1 on #a(id) statement and then exec prcoc2
    In proc2 #a is used, but it does table scan. How can i forse it to use index?

  2. #2
    Join Date
    Nov 2002
    Location
    Switzerland
    Posts
    524
    Depending the size of your temporary table, the optimizer can decide to avoid any index (e.g. less than 200 pages).

    You can force an index added (index indexname) in your select statement (but it's not advised)
    F. Celaia
    DBA Sybase/DB2/Oracle/MS-SQL

  3. #3
    Join Date
    Jan 2004
    Posts
    51
    I think you should either create proc2 with recompile option or execute it with recompile..

Posting Permissions

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