Results 1 to 5 of 5

Thread: Index problem

  1. #1
    Join Date
    Jun 2007
    Posts
    197

    Smile Unanswered: Index problem

    this my script


    CREATE UNIQUE INDEX [RELBFM].[UQ_PMT_PMTNAME] ON [RELBFM]. [ISMPMT] ("PMTNAME" ASC);


    following errors occur
    where i am facing problem
    Attached Thumbnails Attached Thumbnails index.JPG  

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Syntax for a create index statement:
    Code:
    CREATE UNIQUE NONCLUSTEREDINDEX ix_t_name_c_name_nu_nc
    ON schema_name.t_name (c_name ASC) 
    
    Spot the diff
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,799
    Provided Answers: 11
    The original is correct for Oracle, but indexes in SQL Server are assumed to be part of the table's schema. In fact, the "index owner" is not even a concept in SQL Server.

  4. #4
    Join Date
    Jun 2007
    Posts
    197

    Smile

    [QUOTE=pootle flump]Syntax for a create index statement:
    Code:
    CREATE UNIQUE NONCLUSTEREDINDEX ix_t_name_c_name_nu_nc
    ON schema_name.t_name (c_name ASC) 
    
    Spot the diff [/QUOso


    so when we use CLUSTERED AND NONCLUSTERED INDEX

    I had used clustered primary key so what type of index should I use

  5. #5
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Actually the clustered\ nonclustered bit is not mandatory. I just like to put it in so it is explicit. It also appears that there was a copy and paste problem (apologies) - there should be a space between nonclustered and index. The difference was actually as mcrowley said - you "qualified" the index name when you should not have.

    A pk and a not null unique index are exactly the same as far as sql server is concerned.
    Testimonial:
    pootle flump
    ur codings are working excelent.

Posting Permissions

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