Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

INDEX returns cryptic message Expand / Collapse
Author
Message
Posted Tuesday, April 8, 2008 9:59 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, June 18, 2010 11:18 AM
Points: 2, Visits: 45
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
Post #481701
Posted Tuesday, April 8, 2008 10:23 AM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Yesterday @ 11:09 PM
Points: 3,108, Visits: 11,502
You can trap the error with a TRY/CATCH block, and return the error that you want.

Post #481720
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse