Create index if not exists

  • Hi,

    How can find all the tables in a database where a filed(ex. LastUpdateDate) field exists or not.

    If exists, find any non clustered index already exists or not. If not create one.

    Can anybody get the script?

    thanks

  • YOU CAN TAKE INFORMATION BY THESE QUERYs

    select * from information_schema.tables where table_type='base table'

    select * from information_schema.columns where column_name='field name'

    select * from information_schema.KEY_COLUMN_USAGE where column_name='field name'

    Arrange These according your need

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply