Matching criteria SQL Exception Strings is [42501] is not detecting insufficient privilege sql exception. Advise on the right matching criteria to achieve detection of insufficient privilege sql exception.
------------------------------
Gomathi Dasarathan
Consultant - Cyber Endpoint Network Security
NCS Pte. Ltd.
Singapore
------------------------------
Original Message:
Sent: 08-18-2023 01:57
From: Nikhil Nandode
Subject: Custom Policy based on SQL Error Code
Dear Cezmi,
I hope you are doing well,
As per current policy structure we cannot detect error code, only option is to use use some strings contained in SQL Error message. Which is usually text for that error code.
The SQL error code is part of the response for the Query (generally for incorrect query). What sort of security policy is we are expecting to run against it? Can you please give me an example use case for this scenario so that we can try to create something to detect the same.
Thanks
------------------------------
Nikhil Nandode
Original Message:
Sent: 08-16-2023 05:05
From: Cezmi Cal
Subject: Custom Policy based on SQL Error Code
Hi all,
I want to create custom security policy based on SQL Error Code field (selected with red rectangular below). I tried following but not achieved:
- Tried to use this code in "SQL Exception Strings" field.
- Tried to use this code in Custom Field of "Advanced Criteria"
If I create policy by putting strings from Error Message in "SQL Exception Strings", it works but I want to create security policy based on error codes.

Thanks.
#DatabaseActivityMonitoring
------------------------------
Cezmi Cal
technical support engineer
Barikat Internet Guvenligi Bilisim Ticaret A.S.
Ankara
------------------------------