troubleshooting Question

Set Error Statement for Users

Avatar of Mehram
MehramFlag for Pakistan asked on
Microsoft SQL Server 2005
12 Comments1 Solution215 ViewsLast Modified:
We have the below mentioned index on our table tankers, which is working great. However we need to set our own error for users to better understand problem

Error statement would be like this:
Sorry the record could be updated because the same record exist into the database against trailerno, loadon & Loadby

My Unique index coding as below:

USE [OilDB]
GO
/****** Object:  Index [IDX_Tankers_unq]    Script Date: 12/24/2009 13:15:59 ******/
CREATE UNIQUE NONCLUSTERED INDEX [IDX_Tankers_unq] ON [dbo].[tankers]

([TrailerNo] ASC,
[LoadOn] ASC,
[Lb] ASC
)
WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]

ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 12 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 12 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros