August 11th, 2009
I where planning to write a blog post about Change Data Capture (CDC) in SQL Server 2008, but then I stumbled upon Pinal Dave’s article Introduction to Change Data Capture (CDC) in SQL Server 2008.
It is a thorough overview of Change Data Capture (CDC).
MSDN reference for Change Data Capture (CDC).
Tags: SQL Server, SQL Server 2008
Posted in SQL Server | No Comments »
June 23rd, 2009
tripwiremagazine.com has gathered a neat collection of cheat sheets for web developers.
I’m not a front end web developer, so I’m in desperate need of tools and cheat sheets that can help me look good, when venturing into the world of web design
Tags: shortcut keys
Posted in Everyday coding, Useful tools | 1 Comment »
May 21st, 2009

I can’t wait to see what Microsoft can get out of WPF with the new WPF-based IDE.
The Microsoft developer and platform evangelist Dan Fernandez has written an installation cheat sheet guide.
Update 13th July 2009: On the BCL Team Blog Justin Van Patten has written the blog post What’s New in the BCL in .NET 4 Beta 1.
Tags: Visual Studio
Posted in Announcement, Visual Studio | No Comments »
April 23rd, 2009
… or create a custom binding from a build-in binding.
… or create an administrative XML-based configuration from an administrative programmatic configuration.
Below codes does all that:
// Specify the source binding
// - Programmatic binding
// - Administrative XML-based binding
// - Convert to custom binding
/* Programmatic binding */
var binding = new BasicHttpBinding();
binding.TransferMode = TransferMode.Streamed;
binding.MaxReceivedMessageSize = 10000;
/* Administrative XML-based binding */
// var binding = new BasicHttpBinding("basicHttp");
/* Convert to custom binding */
// var wsBinding = new WSHttpBinding("wsHttp");
// var binding = new CustomBinding(wsBinding);
string outputConfigFile = "out.config";
Configuration machineConfig = ConfigurationManager.OpenMachineConfiguration();
var fileMap = new ExeConfigurationFileMap();
fileMap.ExeConfigFilename = outputConfigFile;
fileMap.MachineConfigFilename = machineConfig.FilePath;
Configuration config = ConfigurationManager.OpenMappedExeConfiguration(fileMap, ConfigurationUserLevel.None);
config.NamespaceDeclared = true;
var scg = new ServiceContractGenerator(config);
string sectionName, configName;
scg.GenerateBinding(binding, out sectionName, out configName);
config.Save();
The programmatic source binding will create a configuration file with all default values for the BasicHttpBinding except for TransferMode and MaxReceivedMessageSize attributes like so:
<basichttpbinding>
<binding name="BasicHttpBinding"
closeTimeout="00:01:00"
openTimeout="00:01:00"
receiveTimeout="00:10:00"
sendTimeout="00:01:00"
allowCookies="false"
bypassProxyOnLocal="false"
hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536"
maxBufferPoolSize="524288"
maxReceivedMessageSize="10000"
messageEncoding="Text"
textEncoding="utf-8"
transferMode="Streamed"
useDefaultWebProxy="true">
<readerquotas maxDepth="32"
maxStringContentLength="8192"
maxArrayLength="16384"
maxBytesPerRead="4096"
maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None"
proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName"
algorithmSuite="Default" />
</security>
</binding>
</basichttpbinding>
I found this tip by Brian McNamara on the MSDN WCF forum.
Tags: dotNet, WCF, XML
Posted in .Net, Useful tools, WCF | No Comments »
April 16th, 2009
Today I just witness the electronic annual general meeting for the investment company SparIndex. This is the first 100% electronic annual general meeting ever.
The stakes was high, especially for the system owner VP Securities as journalists and photographs wandered around the offices ready to report success or failure in the media.
My job as a technical consultant, together with a handful of other techies, was to monitor the solution during the live annual general meeting. Our job was to prevent any technical glitches or in the event of a crash recover as fast as possible.
The tension was high right up to the last minute before the premiere, but everything went smooth.

Screenshot of the World’s first electronic annual general meeting
Posted in Announcement | No Comments »
April 6th, 2009

I was using SQL Server Profiler on a SQL Server 2005 Enterprise Edition looking for performance culprits, when I stumbled upon this very long running process.
I think this must be a world record.
This statement has only used 16 milliseconds of CPU but it has been running for more than 500.000 years!
Tags: SQL Server
Posted in Code fun, SQL Server | No Comments »
March 24th, 2009

Recently when I was flying back to Europe from South Africa with Lufthansa on Airbus A340-600 the In-flight entertainment crashed just before takeoff. They had to restart the entire system. I could see the entire reload of the system including the initial download with 115K baud XModem protocol download.
Yikes! I hope that only non-vital systems are running Windows for an airliner.
Posted in Announcement | 2 Comments »
March 21st, 2009
Watch out when using @@IDENTITY and SCOPE_IDENTITY() in your applications. Below is a quote from a Microsoft SQL Server engineer.
… whenever a parallel query plan is generated @@IDENTITY and SCOPE_IDENTITY() are not being updated consistently and can’t be relied upon.
You can find more about the bug and workarounds at the SQL Server bug report.
UPDATE 28MAR2009: Pinal Dave has a more detailed blog post about the bug with workaround.
Tags: SQL Server
Posted in SQL Server | No Comments »
March 18th, 2009
I have been playing around with the ASP.NET MVC for a couple of month and cannot wait to start the first commercial project – hopefully next week
Frameworks like the ASP.NET MVC, MVCContrib and jQuery has sparked a renewed interest in web development, which has been dormant for years.
Posted in .Net | No Comments »
March 18th, 2009
Run the below query to see which databases that uses read committed snapshot isolation:
SELECT name, is_read_committed_snapshot_on FROM sys.databases
To enable it on a specific database run the below query:
ALTER DATABASE [<databasename>]
SET READ_COMMITTED_SNAPSHOT ON
As a developer I am in love with read committed snapshot isolation feature for SQL Server 2005+. Transactions can read and write simultaneously the same piece of data – no read/write contention due to row versioning.
Normal conflicting scenarios:
Simultaneously write and read of the same data.
- Read committed isolation: The reader will wait for the writer to release the exclusive lock.
- Read committed snapshot isolation: The reader will not block, but receive the latest committed data (latest row version).
Simultaneously writes of the same data.
- Read committed isolation: The second writer will wait until the first transaction completes because of an exclusive lock.
- Read committed snapshot isolation: The first transaction committing will “win” and if the second tries to commit, it will abort and error will be raised.
In effect this is optimistic concurrency control without coding anything. Read more about read committed snapshot isolation and isolation levels in the Isolation Levels in SQL Server 2005 article.
Tags: SQL Server, Transactions
Posted in SQL Server | 1 Comment »