Added ability to generate upgrade scripts.

This is still an incomplete work in progress.

 * Added "-upgrade" command line switch to ScriptDB.exe to support generating upgrade scripts.
 * Moved common script utility methods out of FileScripter into ScriptUtility so they can be used by other scripting classes.
 * Also updated copyright year to 2013.
Modified FileScripter to use MessageReceived events.

The ErrorMessageReceived, OutputMessageReceived, and ProgressMessageReceived events can be used instead of having the output written to the console.

Also suppressed a bcp warning about empty strings converted to null.
Fixed issue with SET QUOTED_IDENTIFIER.

The SchemaUpgradeScripter.TrimDeployScript removed the SET statements at the begining of the script and sqlcmd.exe defaults to SET QUOTED_IDENTIFIER OFF.

I added the SET statements to both the SchemaUpgradeScripter and DataUpgradeScripter and now invoke sqlcmd.exe with the -I arg.
Fixed upgrade verification process.

The source database was used by the UpgradeScripter.GenerateCreateScripts method for generating both the "Expected" and "Actual" script folders, so the scripts always matched.

I fixed this to use the target database when generating the "Actual" scripts folder.
Improved progress messages written to the console.

 * Added elapsed time for some long-running steps.
 * UpgradeScripter.GenerateCreateScripts now writes to a log file instead of flooding the console with output.
Added optimizations and color output enhancements.

 * Added parallel processing optimizations.
 * Optimized DacPackage extract process to use memory storage. We may need to switch this back if it uses too much memory. But it seemed to save cut the extract time in half.
 * Added ExtractTarget method and TargetPackage property to SchemaUpgradeScripter. Using a package target instead of a database target saves some time when generating scripts (but not much). I figure since we need the initial target schema (after running schema prep) for both generating scripts and generating the report, there is probably some savings by generating the package and reusing it for both.
 * Added SchemaUpgradeScripter.GenerateReport to generate the deployment report.
 * Improved output by adding color to errors and warnings and including some extra blank lines for formatting.
 * I upgraded the projects to .NET 4.5 so I could use the latest task parallel library features incorporated into the base class library (e.g. the static Task.Run() method)
Modified DataUpgradeScripter to skip tables only in source or target.

Previously a null reference exception was thrown if a table with data only existed in the source or target.

It still does not gracefully handle any column differences between source and target.
Modified UpgradeScripter to use file patterns for custom scripts.

Also detect and prompt the user whether to continue after an error in a script.
Fixed encoding issues.

Fixed encoding. FileInfo.CreateText was creating UTF8 files (which I expected) but with no byte order mark (not what I expected). Sqlcmd.exe can work with UTF8 files, but only if it identifies the BOM. I changed to using Encoding.Default (windows 1252). That is what the FileScripter class uses and that works reliably for our scripts.

Also:
 * Formatted schema upgrade XML report.
 * Added elapsed time for long running scripts.
Optimized insert statements generated by DataUpgradeScripter.

Instead of using individual insert statements for each row, now insert multiple rows with each INSERT statement using a multi-row VALUES clause. A batch size of 1000 rows per insert statement performed about the same as individual insert statements (at least for my test table). But a batch size of 100 cut down the time considerably.
Support creating source and target databases from directories.

The directories must contain the output from ScriptDB.exe (FileScripter), including a CreateDatabaseObjects.sql script.
Changed output path of Mercent.SqlServer.Management.Tests.csproj.

A C# project should not output to the same directory as another C# project.
Temporary package files are now output to a temp subdirectory.
Modified upgrade to output total elapsed time.
Added ":on error exit" and "SET XACT_ABORT on" to upgrade script.

If there is an error when the generated upgrade script is run we want it to abort.

Note that this does not affect the scripts that are run by ScriptDB while it is generating the upgrade script.
Warn when table has data and no primary key or unique index.

Modified both the FileScripter and DataUpgradeScripter so the warning occurs when generating create scripts and when generating data upgrade scripts.
Don't include computed or timestamp columns in BCP data files.

 * Changed the methods that modify the BCP format files to take a list of columns to include and then remove any columns not in the list. Also refactored the methods for better code reuse.
 * Note that I did not change anything for native (binary) BCP data files (they still include all columns).
Added locking around console operations.

 * The primary reason for locking is to avoid having a parallel task continue to write to the console while a separate task has prompted the user and is waiting for a response. The user may not see the prompt due to the subsequent output.
 * Also made it simpler to output to the console in different colors.
 * Also prompt to retry when there is a failure deleting one of the Actual or Expected directories.
Include single quotes around file names in console output.
Added -SingeFile option.

Using the -SingleFile command line argument (the UpgradeScripter.SingleFileName property) the invidual upgrade files are combined into a single upgrade script.