Per https://www.python.org/dev/peps/pep-0249/#integrityerror, ctds.IntegrityError should be raised when "when the relational integrity of the database is affected". This is somewhat open-ended, but at the very least could follow pymssql's lead and handle specific error numbers. It seems as though the severity level can't be used for differentiating errors for this purpose.
The list of SQL Server 2008 error messages can be found here.
Per https://www.python.org/dev/peps/pep-0249/#integrityerror,
ctds.IntegrityError
should be raised when "when the relational integrity of the database is affected". This is somewhat open-ended, but at the very least could follow pymssql's lead and handle specific error numbers. It seems as though the severity level can't be used for differentiating errors for this purpose.The list of SQL Server 2008 error messages can be found here.