Divide by zero in sql 2008

My app has been running fine on sql 2008 for 10 years. Recently, when I do some actions not related to calculation on the app it shows " divide by zero encountered". Could somebody kindly help me? Thanks!

if you can give some specifics, it will be easier. but in general:

  1. figure out what layer the error is coming from. probably either your app (business logic and presentation) or the backend (SQL Server).
  2. If the latter, and if you can reproduce the error, run SQL Server Profiler to see the queries then recreate the problem to see which query it is,
  3. when you know the failing query, find the division and look at the data it works on. That's likely where your problem lies.

Thank you very much for your reply, gbritton. It was showed: error number: -2147467259 error source: microsoft sql native client. Can this tell where the error come from?

step 2:

run SQL Server Profiler to see the queries then recreate the problem to see which query it is,

I only can see " EXECUTE msdb.dbo.sp_sqlagent_get_perf_counters"

image

it's a Windows app

Also available within SSMS:

image

1 Like

Or use Extended Events