Incorrect coding may cause cause SQL errors when executing.
Impact : Medium
SQL Exceptions will interrupt user flow, and potentially may cause a lack of functionality and influence application performance. This can have a strong negative impact on overall system value by degrading the performance and reliability of the data.
Expected behavior :
SQL exceptions are unexpected and need to investigated.
Query Analyzer provides comprehensive information about the error. Example: Network error code 0x79 occurred while establishing a connection; the connection has been closed. This may have been caused by client or server login timeout expiration. Time spent during login: total 19121 ms, enqueued 0 ms, network writes 0 ms, network reads 0 ms, establishing SSL 19120 ms, network reads during SSL 19120 ms, network writes during SSL 0 ms, secure calls during SSL 0 ms, enqueued during SSL 0 ms, negotiating SSPI 0 ms, network reads during SSPI 0 ms, network writes during SSPI 0 ms, secure calls during SSPI 0 ms, enqueued during SSPI 0 ms, validating login 0 ms, including user-defined login processing 0 ms. [CLIENT: 10.90.133.196]See our recommendations regarding network errors here.
SQL exceptions occur where a query has invalid code that cannot be executed.
Some examples are
- The DELETE statement conflicted with the REFERENCE constraint …
- type conversion failed
- Subquery returned more than 1 value.
- Incorrect syntax near …
- query timeout
- Column ‘….’ is invalid in the select list
- Invalid column name
- Statement(s) could not be prepared
- Network error code 0x79 occurred while establishing a connection; the connection has been closed.