Monday, July 30, 2012

Just a Bit - implicit conversions and the BIT datatype

Consider the following:

DECLARE @I int;
DECLARE @B bit;
DECLARE @False bit;
DECLARE @True bit;


SET @False = 'false';
SET @True = 'true';
SET @I = -5;

--this much we pretty much expect
select @False, @True

-- but what about this ?
WHILE @I < 5
BEGIN
SET @B = @I;
SELECT @I
, @b;
SET @I = @I + 1;
END

While the BIT datatype will throw errors

Jumbled Unreadable SSRS Report Details


In developing reports which have many columns, you may find that the detail lines become jumbled up and unreadable.  Note that the column headers are just fine though.


To save time and headache with your reports, always select your detail line(s) withing the IDE and be sure that the background color is not set to "clear".  In fact, giving them each a color is a good idea.  Note also that the default templates provided by MS always have a background color set.


I can't rationally explain why this matters, it's just one of those things to be written off as "magic".