Wednesday, 18 June 2008

SQL Express


Most often our apps are involved with databases. Since the release of SQL Server 2005, Microsoft announced a light-weight version of SQL named: SQL Express.
SQL Express is a successor of Microsoft Database Engine and is the freely-downloadable and distributable version of Microsoft's SQL Server relational database management system.
It offers a database solution specifically targeted for embedded and smaller-scale applications. Unlike its predecessor, MSDE, there is no concurrent workload governor which "limit[s] performance if the database engine receives more work than is typical of a small number of users." It does, however, have a number of technical restrictions which make it undesirable for large-scale deployments.
You can find these restrictions list from here.
The latest release of it is SQL Express Service Pack 2.
You can get it from here.

SQL Express have a small setup file size (about 54 MB) and can be installed very easily.

You can have silent setup of SQL Express with these command arguments:
-q /norebootchk /qn reboot=ReallySuppress addlocal=all instancename="sqlexpress" SQLAUTOSTART=1 ADDUSERASADMIN=1

(For complete listing visit here)

Also note that SQL Express has some prerequisites like:
Windows Installer 3.1 and .NET Framework 2.0

Before your install script tries to install SQL Express, you check whether SQL Express is installed or not.
You just need to check this registry entry:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\SQLEXPRESS\MSSQLServer\CurrentVersion

If the value of "CurrentVersion" is some thing like (or greater than) this: 9.00.3042.00
Then the SQL Express SP2 is already installed and your setup program does not need to install it again.