SQL Server Exception Question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In SQL Server, if an attempt is made to input to the database a record with
an id number that already exists, what exception is generated?

Thanks,
Fred
 
All exceptions thrown by the DB will be SqlExceptions - the message will be
something like System.Data.SqlClient.SqlException: Violation of PRIMARY KEY
constraint 'Key_Name'. Cannot insert duplicate key in _____
 
Back
Top