This problem is actually quite easy to solve, using this: NULLIF(Divisor,0) NULLIF will check whether the Divisor is equal to zero. If it is, then it specifies the value to be NULL therefore it won’t trigger the SQL Server error message. More info: http://msdn.microsoft.com/en-us/library/ms177562.aspx
Posts Tagged ‘workaround’
Division By Zero Error
Posted in SQL Server, tagged tsql, workaround on 28 May 2009 | Leave a Comment »
How to convert datetime data type
Posted in SQL Server, tagged tsql, workaround on 10 May 2009 | Leave a Comment »
I must admit I dislike the SQL datetime data type – it’s long, ugly and not always readable. So I totally understand why some people will go a distance to make this type easier for them (to read, that is). Well, the good news is there is a way to convert datetime format to other [...]
Database Stuck In Restoring State
Posted in SQL Server, tagged restore, workaround on 5 May 2009 | Leave a Comment »
Symptom: You found a database that is restoring/loading mode after so many hours (or days) and after refresh, the database is still restoring. Why: This usually occurs due to an ‘unclean’ connection. For example, a client who initiated the restore, was disconnected during the process, leaving the Restore ‘hanging’. Or you might forget to include [...]