pointers, solutions and toolbox scripts for the SQL DBA
not intended to replace msdn, common sense or oxford commas

Monday, April 12, 2010

LINQ doesn't like TINYINT PK IDENTITY fields

So, to save space (and it is a bit archaic, but why not) I sometimes use tinyint and smallint for the PK IDENTITY columns in small lookup tables.

For example, a list of counties or congressional districts for a state government project.  Will never be more than 255 or negative.  Tinyint.  1 byte instead of 4.

Yeah yeah, I'm aware that in the long run, that adds up to very little saved disk space.  Very little.  Still, I can't help but be tight with data type constraints.  Its not like I will be allowing every column to be declared varchar(8000), much less varchar(max), even when "disk space is cheap".  Its not like I'll be using bigint instead of int when I know I'll never get more than 2 billion records. 

Except that when your developers want to use LINQ, you can't use a TINYINT IDENTITY column. Stupid error.

Changed it, begrudgingly, to smallint.  2 bytes instead of 4.  Grrr...

Read more:

Friday, April 09, 2010

SSRS Web Site vs Web Service

Had an issue yesterday where installing Microsoft CRM couldn't find the reporting server.

The error was a 404, essentially, the CRM install couldn't see the Reporting server.

The issue was that we had copy-pasted the Reporting Services web site


instead of the Reporting Services web service



In conclusion: don't do that.

"The best way to find yourself is to lose yourself in the [web] service of others." -Mahatma Gandhi [and this blogger]

Monday, April 05, 2010

TFS Sidekicks

I've do a lot of DB Pro solutions and DBA code reviews at my office and on client sites. This free sidekick add-on for Visual Studio has been invaluable.


Whenever I want to look at files included in a TFS changeset, or all files checked in to TFS for one work item, or comparison across changesets, I find this Visual Studio plugin extremely handy.

For example, I use it for Code Reviews, to compare changes across all Changesets for a given Work Item. It has a quick function to compare the latest version of a file to the latest version of a file before this work item. Ridiculously efficient, I've forgotten how I'd do this before.

Very quick install, low-impact. I imagine it could be very handy for lots of different Source Control-related sources and diffs in Visual Studio that you just can’t do with Visual Studio alone. Anyone else use it?

Friday, April 02, 2010


Follow this blog's auto-twits- @SQLTact
Follow the Baton Rouge SQL Server User Group- @BRSSUG
Follow Baton Rouge SQL Saturday (August 14, 2010!)- @SQLSatBR

"Whoever said that things have to be useful?" – Evan Williams, co-founder of Twitter