all groups > sql server odbc > march 2004 >
You're in the

sql server odbc

group:

Equivalant Exception for DUP_VAL_ON_INDEX for SQL Server


Equivalant Exception for DUP_VAL_ON_INDEX for SQL Server Aparna
3/31/2004 3:21:06 AM
sql server odbc:
Hello

We are in the process of migrating the Oracle database to SQL Server. We need the help on the Exception Handling in SQL Server

The existing Oracle stored procedure is using the Exception DUP_VAL_ON_INDEX, which raises when the duplicate values gets inserted in the Indexed column. (typcially used with INSERT statement

We need the equivalant statement for the exception mentioned above

I request you to elp us out in this case.

Re: Equivalant Exception for DUP_VAL_ON_INDEX for SQL Server Sue Hoegemeier
3/31/2004 12:11:10 PM
Duplicates for a unique index insert return the error number
is 2601. The error message depends on the object name but
it's:
Cannot insert duplicate key row in object '%.*ls' with
unique index '%.*ls'.

-Sue

On Wed, 31 Mar 2004 03:21:06 -0800, Aparna
[quoted text, click to view]
Re: Equivalant Exception for DUP_VAL_ON_INDEX for SQL Server Aparna
3/31/2004 8:51:11 PM
Hello Sue

Good Morning. Thank you very much for the very useful help. Yesterday late evening i tried the same and was at the conclusion of the error no. 2601 as the equivalant in SQL
Your ans. supports that and i an confirmed now

AddThis Social Bookmark Button