ALLINSIGHT

Home of the AlmostImplementedException

Database

SQL Server: Set query governor cost limit

Sometimes you will have the problem that you execute a long, time consuming query, e.g. in a stored procedure. In our case we’ve got a maintanance plan that executes a stored procedure to generate statistics everey day. But for this we will the following error on execution: “The query has been canceled because the estimated […]

TSQL: NULLIF and ISNULL or How to prevent Divide-By-Zero errors

When you do calculations in your database, you sometimes have to deal with null and 0 (zero) values. This can lead to Divide-By-Zero errors or null-results. To prevent them we can use ISNULL and/or NULLIF. Lets start with ISNULL. This simple fellow just needs two parameters. First the value to check and second the resulting […]

,

How to find large tables in Sql Server

Sometimes it is necessary to find out which tables are consuming the most space in your database. especially when you run your database for a couple of years. In our case we’ve got an ERP database which holds orders, position, customers, machine controls, print data, … So we need to find table that are predestined […]

, , , , ,