An item with the same key has already been added (SQL Report Services)

Screen Shot 2014-02-26 at 7.42.34 AM


I was creating a new report in SQL Reporting Services, I pasted in the SQL query for the report and up popped the message “An item with the same key has already been added”.

Turns out I had two columns with the same name – which as always with these error messages, begs the question, why not just say so!

Copy Azure SQL Database to local machine (SQL 2008 R2)

You would have thought in these days of point and click a simple task like copying a database from one place to another would be a walk in the park. So when I wanted to take a copy of a SQL database from Azure and move it to my local machine, I thought it surely would be straightforward. It’s not. Here’s what I came up with:

In Azure make sure you have a Storage account set up, with a container inside. My container is called ‘files’.


In Azure go to your database. Click the Export button down the bottom.


A new window will pop up. The file name will probably be pre-filled. Select your blob storage account (if you only have one then it’s already selected). Select a container (mine is ‘files’). Enter your SQL Server log in name and password – these are the credentials you set up when you added the database. Click OK and the export should start – you’ll see the status down the bottom.


Once the export is done, you can click to view your Storage container, and you should see the export file there.


The trick now is to get the file from Azure to your local machine. I use Azure Storage Explorer, it’s a free download. Download the file from your container.


If you have SQL Server 2012, then you are home free, because you can import the BACPAC file in SQL Management Studio. Right click on the Databases folder under a server in the Object Explorer and choosing “Import Data-tier Application.

If like me you are on SQL Server 2008 R2, you need some help.

Create a new blank database on your local machine.

Go to and install the SQL Server Data Tools for Visual Studio 2010. After install go and find SqlPackage.exe, I located it in C:\Program Files\Microsoft SQL Server\110\DAC\bin. Open up a DOS prompt and use the following command:

SqlPackage.exe /a:Import /sf:c:\Desktop\FILENAME.bacpac /tdn:DATABASENAME /tsn:SQLSERVERNAME
  • FILENAME.bapac is the file you downloaded from Azure, whereever it is located on your machine.
  • DATABASENAME is the name of the new blank database you created a minute ago.
  • SQLSERVERNAME is the name of the SQL server on your local machine.

I followed these steps, albeit for a fairly small file, and it worked perfectly.

And this is why the banking system in the USA sucks – $40 fees to transfer $150 between two accounts at the SAME BANK!


I’ve been following with interest stories in the media about the US banking system getting its act together and introducing Chip and PIN security for credit cards. A credit card transaction protected by a chip (embedded in the card) and PIN (a PIN as opposed to a signature) is a much much more secure payment, and far less open to fraud.

I read an article today headlined “American businesses are holding credit card security back“, which actually seems to be more about how the US banking system is holding it back – they are pushing for Chip and signature, a lower grade of security. I particularly thought this quote from the American Bankers Association was a good indicator of the banking sector’s resistance:

“You’ve got both banks and retailers struggling with how to find the right mixture of providing security to customers, yet also the convenience that American customers expect.”

Their argument is consumers don’t want another PIN to remember. What a load of tosh – for most people this is a furphy. I have a Visa card, that is also my EFTPOS card. It’s the same PIN. Nothing more to remember. And is anyone seriously suggesting that signing is faster than tapping in a four digit number?

We’ve had Chip and PIN in Australia for quite a while – along with contactless payments like Visa PayWave, where you just wave your card at the payment terminal for transactions under $100. Terrific technology that saves heaps of time.

Along with card security, it would be nice if the US banks sorted out the fundamentals. Take my experience this week. Someone in the USA owed me $150. Normally he would wire payments to my Australian account, but that costs him $35 for the transfer fee, which seemed silly for $150. The money was sitting in his Bank of America account, so I suggested he just transfer it to my Bank of America account. I never have much money in there, but it’s useful to have a few dollars lying around to cover Netflix and iTunes (for the US iTunes Store).

Here’s where the lunacy begins. My friend sends me the money. The bank charges him a transfer fee of… are you sitting down with a stiff drink in one hand … $US25. I then log into my account and, as you can see from the above screenshot, I’ve been charged a $15 wire transfer fee. A total charge of $40 to move money from one savings account to another WITHIN THE SAME BANK!

Patently ludicrous. If this was Australia, I could have logged into my National Australia Bank app, typed in someone else’s NAB account, and sent them the money, with no fees, and the money be immediately available to the receiving party (it takes a two or three days for Bank of America to make the cash available).

It’s no wonder that disruptive startups like Square, Stripe and others are tackling payments and banking in general. I’ve heard loads of excuses – oh, the inter-changes between the banks in the US are so much more complicated; or, there are multiple funds transfer exchanges; or, there are so many players in the market it’s difficult to gain cooperation and agreement. Whatever. But given the industry association that claims to lead policy for the US banking system itself seems resistant to introducing change, I suspect the main impediment is that more convenience for customers might lead to less price gouging opportunities for all the players with their snouts in the financial services trough.

Yet it seems to this unqualified economist that addressing fundamental structural weaknesses in an economy, such as the ease and free flow of payments, surely must be a driver for growth and expansion. Which then suggests the US banking system is happy to favour short-term profits over long term economic and social benefits. Now where have we seen that before? Oh yup –  when they buggered the home mortgage sector and kindly bestowed the GFC on us all.

Apple definitely taking selling iPhones in China seriously


I can tell Apple is taking the new opportunity of selling iPhones in China really seriously. This update just turned up on my iPhone, and I don’t even live in China. Presumably every iPhone5 user in the world has to install an update just so they can fix a provisioning problem with iPhones sold in China. ‘Provisioning’ is all about activating a new phone on to a phone network, so it looks like they’ve had some issues with Chinese customers unable to use their shiny new smartphones.