SQL Server 2008 R2 Reporting Services: A generic error occurred in GDI+

While building some maps today in SQL Server 2008 R2 Reporting Services, I kept coming up with an error that said:

A generic error occurred in GDI+

I was struggling to think what I’d done wrong. After much nashing of teeth and removal of hair, I finally worked out what the error was. When I got to the “Choose Color Scheme and Visualization” page of the map wizard for building a color analytical map, I hadn’t picked the correct value for the “Field to Visualize” drop-down. I’m guessing that because it had defaulted to my GEOMETRY column, instead of the field that I actually wanted to use for analysis, it must get itself into some sort of stack overflow or nesting problem.

Regardless, the error message isn’t helpful. Picking the correct column to visualize solved the problem.

Hope it helps someone else (or me when I forget and do it again in future :-))

Backup a Single Table in SQL Server using SSMS

Our buddy Buck Woody made an interesting post about a common question: “How do I back up a single table in SQL Server?”

That got me thinking about what a backup of a table really is. BCP is often used to get the data but you want the schema as well.

For reasonable-sized tables, the easiest way to do this now is to create a script using SQL Server Management Studio. To do this, you:

1. Right-click the database (note not the table)

2. Choose Tasks > Generate Scripts

3. In the Choose Objects pane, select the table you want to script

4. In the Set Scripting Options pane, click Advanced.

5. In the Types of Data to Script option, choose Schema and Data. (If you also want indexes, etc. make sure they are also chosen)

Click your way through the remaining screens and you’re done.