Tuesday, September 30, 2008

DBCC commands to clear SQL server cache for speed tests

[quote name="Andrew Holliday"]
When tuning SQL Server applications, a certain degree of hands-on experimenting must occur. Index options, table design, and locking options are items that can be modified to increase performance. When running a test, be sure to have SQL Server start from the same state each time. The cache (sometimes referred to as the buffer) needs to be cleared out. This prevents the data and/or execution plans from being cached, thus corrupting the next test. To clear SQL Server’s cache, run DBCC DROPCLEANBUFFERS, which clears all data from the cache. Then run DBCC FREEPROCCACHE, which clears the stored procedure cache.

Thursday, September 18, 2008

How to alternate colors in a Matrix even when RowNumber doesn't work

Most of the time you can easily alternate colors using:
Table: =iif(RowNumber(Nothing) Mod 2,"Green","White")
Matrix: =iif(RowNumber("Matrix_RowGroup") Mod 2,"Green","White")

The above is by far the most popular method of accomplishing the task, it is widely known and very simple.  However it has one major downfall, when the matrix doesn't receive any data for a specific cell it must generate a blank cell, when that happens the RowNumber count does not get auto incremented which can really throw the coloring off.

Chris Hays came up with a great workaround hack to this issue.  You can create a static grouping at the lowest level and use RunningValue to calculate an alternating value for the group header cell, then hide the cell and point the data cells BackgroundColor to the value of the group header cell.
=iif(RunningValue(Fields!Country.Value,CountDistinct,Nothing) Mod 2, "AliceBlue", "White")

I would highly recommend visiting Chris's blog where he gives step by step instructions on how to accomplish the task.

Friday, September 5, 2008

Google Down?

I just rebooted my computer and one of the first apps I started back up was Google's Chrome browser.  And this is the screen I saw:

After getting over the initial shock of google's website being down I refreshed the page and life was good again.  I didn't believe their site would actually go down so easily so I tried to recreate the problem.  I found I got the error if I disabled my network connection so apparently the network drivers just hadn't loaded yet or were over loaded when Chrome tried to connect.

I do think it would be nice if Chrome were smart enough to know if it were actually connected to the net or not before suggesting to me that a site is down.  Or at least change the message so it says it couldn't connect to it rather than alude that the site itself is having issues.