SQL Server Table Designer Bug With Filtered Unique Index

A colleague was getting a duplicate key error when trying to add a new column to a table via the Table Designer in SQL Server Management Studio (2008R2 - not tested on other versions), despite there being no violating data in the table. After a bit of digging around, I tracked the problem down to what appears to be a bug in Table Designer when there is a unique, filtered index in place on the table and the table is being recreated (i. [Read More]

MongoDB ASP.NET Session Store Provider v1.1.0

Since I created the MongoDB ASP.NET Session State Store Provider (v1.0.0), a few things have moved on in the MongoDB C# Driver. I’ve pushed a number of changes up to the project on GitHub (which I’ve incremented to v1.1.0), so it now uses v1.7.0.4714 of the driver. There is no change to way it is configured in web.config, so if you are using v1.0.0 of my provider it should be painless. [Read More]

Importing twitter archive into ElasticSearch

I recently downloaded my full history of tweets from Twitter (via the “Request your archive” button on the Settings page), which gives the data in CSV and JSON formats. The download comes with a simple web UI so you can browse locally, all your historical tweets, as well as perform basic searches. When I tried performing a wildcard search, it resulted in an unresponsive script warning and nobbled the browser tab. [Read More]

Configuring Azure Storage Emulator SQL Server Instance

If you’re using Windows Azure Storage, you are almost certainly going to be running the storage emulator during development, instead of working directly against your storage account up in the cloud. This emulator (which comes in the Windows Azure SDK - see the “other” category), allows you to test locally against local instances of Blob, Queue and Table services. As per the Overview of Running a Windows Azure Application with Storage Emulator reference, the emulator needs a local SQL Server instance. [Read More]
Azure 

Error Creating Azure Blob Storage Container

I received a rather…vague…error when trying out a bit of .NET code to connect to a Windows Azure Blob Storage account, and create a new container in which to store some blobs. The code CloudStorageAccount storageAccount = CloudStorageAccount.Parse( "DefaultEndpointsProtocol=https;AccountName=REMOVED;AccountKey=REMOVED"); CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient(); CloudBlobContainer container = blobClient.GetContainerReference("TestContainer1"); container.CreateIfNotExist(); // This error'd The error A StorageClientException was thrown saying “One of the request inputs is out of range.”. An inner WebException showed that “The remote server returned an error: (400) Bad Request. [Read More]
.NET  Azure 

ASP.NET MVC Performance Profiling

Building up a profile of how a web application functions, all the database interactions that take place and where the server-side time is spent during a request can be a challenging task when you are new to an existing codebase. If you’re trying to address the generic/non-specific “we need to improve performance / it’s slow” issue, you need to get a good picture of what is going on and where to prioritise effort. [Read More]

Trust your developer instinct and experience

That feature you’re implementing, that bug you’re fixing, that performance improvement you’re trying to make…it’s using up a fair few brain CPU cycles trying to analyse how best to implement it. Scalability, performance, ease of maintenance, clean code…just some of the things you are mentally scoring your potential approaches against to determine which route to take. And that’s without any mention of business domain logic. We’ve all been in the situation where you start heading down one path only to find a hurdle. [Read More]

Ordnance Survey Data Importer Coordinate Conversion Accuracy

Update 13 March 2013: Please see latest blog post (fix) on this here. Thanks to a comment on my original post around my project that imports Ordnance Survey CodePoint data into SQL Server, I was made aware of a potential issue with the (awesome) third party GeoCoordConversion DLL I use to convert the Eastings/Northings coordinates supplied in the Ordnance Survey data files, into Latitude/Longitude coordinates. The issue relates to an inaccuracy in the conversion process, specifically to do with integer divisions instead of double. [Read More]

Quick win - check your table variable use

Quick wins are awesome. Making a change that takes minimal effort and yields a significant performance improvement is very satisfying. This particular potential quick win relates to the use of table variables vs. temporary tables. Have a non-trivial stored procedure that produces some intermediary results and stores in a table variable which then goes on to be used further in the stored procedure? Consider evaluating a switch to a temporary table instead. [Read More]

Automating Web Performance Stats Collection in .NET

You have a web application. You’re a .NET developer. Maybe you already have some automated UI testing in place via Selenium, or maybe you don’t. What you want to do is automate the collection of some performance metrics about your application. Q. How would you go about doing that in .NET? A. Use the following recipe for success. Ingredients BrowserMob Proxy by Webmetrics, which (quote) is: A free utility to help web developers watch and manipulate network traffic from their web applications [Read More]