Friday, July 14, 2006

Making a case for COM, in 2006

Recently I needed a quick utility to script out a SQL Server 2000 database, for comparison purposes, to evaluate "other developer changes" to the system. Even though I've worked with .NET since it first came out, I could not see any advantage to using unmanaged code in a .NET solution, adding unnecessary complexity; so I fired up VB 6.0 and used the SQL-DMO library, along with the Scripting Runtime.

The utility is only intended for use on PC's that have the SQL client tools installed (which includes the SQL-DMO dll) , and therefore the only deployment was to copy a tiny EXE to the target PC.

On the other hand, when it comes time to write the same utility for SQL Server 2005, I will certainly go the .NET route using the SQL Management Objects. But of course for that, we'll need to verify the .NET framework is installed, proper version etc.