INDEX returns cryptic message

  • I have created Indexes on various tables, some prevent duplicates by using Unique record options

    The index returns non user friendly messages if violated such as “Cannot insert duplicate key row in object 'dbo.mytable' with unique index 'UIX_unique_Index'.

    The statement has been terminated.”

    Is it possible to have my own message returned or no message at all?

    Thanks

    CB

  • You can trap the error with a TRY/CATCH block, and return the error that you want.

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

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