April 4th, 2010
The conference Miracle Open World 2010 is soon upon us at Legoland (April 14.-16.)
There will be four tracks this year: Oracle track, SQL Server track, .Net track and a workshop track.
The conference is legendary because time spend at the conference is divided between 80% technical stuff and 80% social networking. No kidding’ socializing is a big part of this conference with gala-dinner and the not-to-miss beach party at Lalandia Aquadome (including drinks).
This year I only have one session where I’ll be presenting Lucene.Net.
Session abstract:
Lucene is an open source full-featured text search engine library, making searching in large amounts of text lightning fast. Lucene are in use by many large sites like Wikipedia, LinkedIn, MySpace etc.
It is easy to get started with Lucene, but there are many pitfalls… In this session you will learn about the do’s and don’t’s for indexing and searching, tools, scaling, new features in version 2.9 and some of the more advanced features.
This presentation will use the Microsoft .Net implementation of Lucene named Lucene.Net, but the content of this presentation applies for ported versions of Lucene.
At the time of writing, 207 participants have registered for the conference. You can still register – it’s not too late.
See more at the Miracle Open World 2010 site.
Posted in .Net, Announcement, Conference, Lucene, SQL Server | No Comments »
April 4th, 2010
With new Wireless Access Points spread around the office building, we can now utilize the full potential of the 802.11n protocol.

Tags: Miracle, WiFi
Posted in Stuff | No Comments »
April 2nd, 2010
Yep – It’s true, I’m one year older today.
The American singer and songwriter Marvin Gaye and Hans Christian Andersen – the world famous Danish author and poet noted for his children’s fairy tale stories like “The Ugly Duckling” and “The Little Mermaid” – both where born April 2nd.
This is also the day, The Falklands War started where Argentina invades the British Falkland Islands in 1982.
You can read more about April 2nd on Wikipedia.
Now I’m already 33 years old :-S
Tags: Birthday
Posted in Announcement | No Comments »
March 21st, 2010
I needed to compress a lot of files into individual zip archives – I did not want to do it manually
Add the following to a bat file and every file with the extension txt will be compressed into a Zip archive with 7-Zip file archiver:
@echo off
For %%f in (*.txt) do 7z.exe a -tzip %%f.zip %%f
E.g. a.txt will be compressed to the archive a.txt.zip
This was not exactly what I needed, as the dual extension caused problems in later processing. In needed to remove the extension preceding the zip extension – therefore:
@echo off
For %%f in (*.txt) do 7z.exe a -tzip %%~nf.zip %%f
E.g. a.txt will be compressed to the archive a.zip
That’s it
Tags: 7-Zip, Batch, DOS
Posted in Useful tools | No Comments »
March 17th, 2010

Working with SQL Server it is often important to know which edition, version and service pack applied to the instance.
This information easily retrieve with either of these two system functions ServerProperty or @@Version:
SELECT @@VERSION
SELECT SERVERPROPERTY('ProductVersion'),
SERVERPROPERTY('ProductLevel'),
SERVERPROPERTY('Edition')
Both of the returns roughly the same information, but I tend to use the @@Version function as it easier to remember and type.
With the ServerProperty function additional information can be retrieved like MachineName, InstanceName or BuildClrVersion. See more about the ServerProperty function on MSDN.
From the build number alone it is possible to figure out which version of the SQL Server and Service Packs applied via the below table:
|
RTM |
SP1 |
SP2 |
SP3 |
SP4 |
| SQL Server 2008 R2 |
10.50.1600.1 |
|
|
|
|
| SQL Server 2008 |
10.00.1600.22 |
10.00.2531 |
|
|
|
| SQL Server 2005 |
9.00.1399.06 |
9.00.2047 |
9.00.3042 |
9.00.4035 |
|
| SQL Server 2000 |
8.00.194 |
8.00.384 |
8.00.532 |
8.00.760 |
8.00.2039 |
Credit for the above table is due to this site.
Update April 30th 2010: Added SQL Server 2008 R2 RTM build number
Tags: SQL Server
Posted in SQL Server, Useful tools | No Comments »
March 1st, 2010
I had to migrate a SQL Server 2008 instance on to new hardware.
I choose to detach the databases and attach the databases on the new SQL Server 2008 instance on the new hardware. This was easy, but the origin SQL Server instance used mixed SQL Server and Windows Authentication Mode. This also meant that I had to migrate SQL Server logins, as the logins where a mix of SQL Server logins and Active Directory domain accounts/groups.
Both the SQL Server logins and domain accounts/groups has an unique SID (Security Identifier), which ties the logins in the SQL Server with the users in the database.
While the domain accounts/groups resides in the Active Directory domain controllers, the SQL Server logins only resides in the SQL Server. This means, moving domain accounts/groups is easy, by just creating the same users in the new SQL Server instance, but SQL Server logins is not. I could either choose to:
- Recreate the SQL Server logins with new users in each of the databases, as new SQL Server logins will get new SIDs and therefore not be tied to the old database users. This also requires that you know all the passwords – alternative reconfigure all the client applications using SQL Server logins
- Transfer the SQL Server logins with SID and password
How to transfer SQL Server logins? See the KB article: How to transfer the logins and the passwords between instances of SQL Server 2005 and SQL Server 2008. Easy
Tags: Security, SQL Server, SQL Server 2008
Posted in SQL Server, Security | No Comments »
January 14th, 2010
I like Windows 7 x64, but I hate Cisco’s lack of support for the IPSec protocol on 64-bit platforms. Many of our customers use IPSec and the Cisco VPN Client – therefore I cannot connect to the customer’s network via IPSec VPN tunnels on my primary laptop
Until today
A colleague of mine recommended Shrew Soft VPN Client. It’s free and works like a charm. It’s a lot faster connecting and negotiating to the remote network than Cisco VPN Client, so fast in fact, that I initially thought that the connection failed. I’ve been using it for a couple of days, connecting to multiple customers, without any issues.
Why does Cisco implement a VPN client for x64 platforms?
I guess it is a money making scheme. They want to push their new Cisco VPN boxes and their new Cisco AnyConnect VPN client (expensive!), which makes use of SSL VPN.
Greg Ferro has another critical article Early Death of Cisco VPN Client Forces VPN License Fees with more details about Cisco’s SSL VPN.
I know of a commercial IPSec VPN client from NCP that works fine with Cisco IPSec VPN tunnels, but the steep price tag of $144 USD + taxes is too much.
Update May 31, 2010: Cisco has released an x64 version of their client tools for Windows 7 with IPSec protocol support. Either my money making scheme hypotheses is wrong or Cisco feared the wrath of my blog readers
Tags: Security, Useful tools, VPN, Windows 7
Posted in Useful tools | 2 Comments »
December 3rd, 2009

Lucene.Net is an open source full text search engine library (a port from Java). It is stable and works like a charm – I’ve been using Lucene.Net for a couple of years now and implement a handful of solutions. Lucene is awesome.
If you want to try working with Lucene.Net, then the DimeCast.Net crew has recently made two short webcasts introducing Lucene.Net.

.Net 2.0 made it simple to use transactions with the System.Transactions namespace. Two of the great features are automatic elevation to distributed transactions (and utilize the Distributed Transaction Coordinator) and the other is the simplicity of creating your own transactional resource managers.
The .Net Framework defines a resource manager as a resource that can automatically enlist in a transaction managed by System.Transactions – which means that any object that implements any of the following interfaces can enlist in a transaction:
- IEnlistmentNotification for the two-phase-commit protocol
- IPromotableSinglePhaseNotification for the single-phase-commit protocol (non-distributed transactions)
To implement a resource manager for the Lucene.Net IndexWriter, and therefore make it transactional, all you have to do is the following:
public class TransactionalIndexWriter : IndexWriter, IEnlistmentNotification
{
#region ctor
public TransactionalIndexWriter(Directory d, Analyzer a, bool create, MaxFieldLength mfl)
: base(d, a, create, mfl)
{
EnlistTransaction();
}
/* More constructors */
#endregion
public void EnlistTransaction()
{
// Enlist in transaction if ambient transaction exists
Transaction tx = Transaction.Current;
if (tx != null)
tx.EnlistVolatile(this, EnlistmentOptions.None);
}
#region IEnlistmentNotification Members
public void Commit(Enlistment enlistment)
{
base.Commit();
enlistment.Done();
}
public void InDoubt(Enlistment enlistment)
{
// Do nothing.
enlistment.Done();
}
public void Prepare(PreparingEnlistment preparingEnlistment)
{
base.PrepareCommit();
preparingEnlistment.Prepared();
}
public void Rollback(Enlistment enlistment)
{
base.Rollback();
enlistment.Done();
}
#endregion
}
You can use it like so:
IndexWriter indexWriter = null;
TransactionScope tx = null;
try
{
tx = new TransactionScope();
indexWriter = new TransactionalIndexWriter(...);
// Perform transactional work
indexWriter.AddDocument(new Document());
indexWriter.AddDocument(new Document());
indexWriter.AddDocument(new Document());
// Connect to Database, MSMQ etc. to elevate to a distributed transaction
// Commit transaction
tx.Complete();
}
finally
{
if (tx != null)
tx.Dispose();
if (indexWriter != null)
indexWriter.Close();
}
Fairly simply uh? Just remember to instantiate the TransactionalIndexWriter or call the public method EnlistTransaction within the scope of an ambient transaction.
You might consider implementing IDisposable for TransactionalIndexWriter so you can take advantage of the using statement.
I will leave it to the reader to implement a TransactionalIndexReader.
Lucene.Net is an open source full text search engine library (a port from Java). It is stable and works like a charm – I’ve been using Lucene.Net for a couple of years now and implement a handful of solutions. Lucene is awesome.
If you want to try working with Lucene.Net, then the DimeCast.Net crew has recently made two 10 short webcast introducing Lucene.Net (http://dimecasts.net/Casts/ByTag/Lucene).
Tags: dotNet, Lucene.Net, Transactions
Posted in .Net, Full Text Search, Lucene | 2 Comments »
November 5th, 2009
I’m going to TechEd conference in Berlin next week. Are you going?
I haven’t taken the time to browse through the session catalogs yet, but I will be seeking information about:
- Microsoft’s acquisition of FAST Search and how Microsoft incorporates into their products
- Microsoft SQL Server 2008 R2 and especially the spatial support for Reporting Services
- The new features of Windows Communication Foundation 4.0, the redesigned Windows Workflow Foundation 4.0 and .Net 4.0 in general.
- The Windows Azure Platform
- ASP.Net MVC 2
If you are going, drop me a mail and I’ll buy you a beer. That’s the least I can do for my readers
Tags: TechEd
Posted in Announcement, Conference | 2 Comments »
October 29th, 2009
I love ASP.Net MVC – It has made web development fun. It also introduced new pitfalls…
Microsoft MVP Simone Chiaretta has fathered 12 ASP.NET MVC Best Practices worth reading.
In particular I find the these items interesting:
Tags: dotNet, MVC
Posted in .Net | No Comments »