Trying out NDepend

What is this? I got the chance to try out NDepend, although with everything else, it took me quite some time until I finally got around to picking it up. Now NDepend is a tool, both command line, stand alone and as an addin to Visual Studio which allows you to do static analysis and reporting...

Free coverage contro...

Code coverage is a good tool to force you to keep maintaining and adding unit and integration tests to your solution. It also increases your confidence in making changes if you can see that the code your changing is actually covered by tests both before and after your changes. Problem is,...

SQL query statistics

This is no work of mine but I wanted to highlight it since it´s such a good thing to utilise when optimizing your database and queries. PgSQL SELECT SUBSTRING(qt.text, (qs.statement_start_offset/2)+1, ((CASE qs.statement_end_offset WHEN -1 THEN DATALENGTH(qt.text) ELSE qs.statement_end_offset...

Rounding or grouping...

When retrieving data for statistical usage in SQL it´s oftenly useful to group the data to some kind of time interval. Easiest and most used is probably simple grouping by date: PgSQL SELECT cast(Timestamp as date), COUNT(*) FROM MyTable GROUP BY cast(Timestamp as date) 1 SELECT...

Want to group by dat...

When extracting timed statistics from SQL you usually want these stats grouped by some kind of time and more often than not this time unit is days. I used to do this unnessesarily complicated by converting the dates to varchars in formats I didn’t even want and maybe even use...

Table size

When using large databases it might be interesting to keep an eye out on what of your tables that actually consumes all that disk. There´s a lot of resources on this out there but I thought I´d repeat it anyways since its such a neat little thing: PgSQL EXEC sys.sp_spaceused 'thetable' 1 EXEC...