Eror Message

Results 1 to 2 of 2

Thread: Eror Message

  1. #1
    Join Date
    Dec 1969

    Default Eror Message

    Is there a quick way of displaying a "friendly" message to trap primary key violation in SQL server? The default message of SQL server is - <BR><BR>Microsoft OLE DB Provider for ODBC Drivers (0x80040E2F)<BR>[Microsoft][ODBC SQL Server Driver][SQL Server]Violation of PRIMARY KEY constraint &#039PK_Enrollment&#039. Cannot insert duplicate key in object &#039Enrollment&#039.<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Eror Message

    Do a SELECT for your new key value BEFORE the insert... if it returns an empty recordset you can INSERT otherwise issue "Friendly" Message...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts