• Try this:

    -- finding system generated constraint names

    select name from sysobjects

    where

    substring(name,rtrim(len(name))-8,len(name)) like '[__][0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F][0-9,A-F]'

    -- finding system genereated indexes

    select name from sysindexes

    where

    name like '[_]WA%'

    quote:


    I started off with SQL 6.5 when Enterprise Manager was given the euphenism Enterprise Mangler therefore we always used TRANSACT SQL and explicitly named every constraint.

    SQL also creates system indices when it needs that cause the same problems as discussed in this article.

    In SQL 6.5 if you didn't delete the indices BEFORE you DROPped a table then you would end up with an orphaned index, therefore I set up a routine to remove all constraints and indices prior to dropping the table.

    In SQL 7/2000 my routine keeps hitting system indices and falling over.

    Does anyone know a way of identifying system indices or constraints?


    Gregory A. Larsen, MVP