In order to integrate VSTS 2008 Database Edition fully into your development lifecycle, one thing you will probably want to do is kick off a data generation plan automatically during certain activities. Luckily, this is built into some scenarios, like running unit tests--by specifying the "test data" configuration, you can optionally choose to have a database deployment and data generation plan execute prior to the tests starting. Sometimes, however, you just want to run a DG plan, and don't want to have to open the file in VS, click the little button, select the database, and answer the "should I truncate the tables first?" question. One great way to get around this is to use a built-in MSBuild task that was provided to run data generation plans. You can incorporate it into a particular build configuration, or just write yourself a small standalone MSBuild project, along with a bat file to kick it off.
Here's a quick sample, stolen and modified from this post in the MSDN forums:
Filename: RunDataGen.proj
<Project DefaultTargets="DataGen" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--Import the settings-->
<Import Project="C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.0\TeamData\Microsoft.VisualStudio.TeamSystem.Data.Tasks.targets" />
<Target Name="DataGen">
<Message Text="$(MSBuildBinPath)"/>
<DataGeneratorTask
ConnectionString="$(ConnectionString)"
SourceFile="$(SourceFile)"
PurgeTablesBeforePopulate="$(PurgeTablesBeforePopulate)"
/>
</Target>
</Project>
Filename: RunDataGen.bat
C:\Windows\Microsoft.NET\Framework\v3.5\msbuild.exe RunDataGen.proj /p:ConnectionString="server=(local);database=MyDatabaseName.Deployed;Trusted_Connection=true";SourceFile="C:\Projects\MyProject\MyProject.Database\Data Generation Plans\LoadTablesForUnitTests.dgen";PurgeTablesBeforePopulate=True
Updated: Now that the Power Tools for VS2008 have been released, I recommend that you use the Sequential Databound Generator, FileBound Generator, and Data Generation Wizard for these scenarios.
A while back, I put up a sample implementation of a custom data generator for VS 2005, to allow the generation of known static lookup values in a data generation plan. This was just something I was using to fill a gap until Microsoft released the Power Tools for VSTS 2005 DB Pro, which came with the Sequential Databound Generator, which was way more robust. When VS 2008 was released, the Sequential Databound Generator was not included. It was intimated that this critical gap would be filled with an updated Power Tools for VSTS 2008 DB release soon, but until that day comes, I have been using an updated implementation of the original sample code, that will work with VS 2008. I've added static value generators to output the following .NET data types: bool, byte[], DateTime, int, string, as well as an installer.
Usage instructions from the original post still apply.
If you have already installed VS2008, and then try and install SQL Server 2005 Dev, you will probably get an error message about changing versions. If you proceed with the installation, the core database components will still be installed, but you won't get the client tools. This is because VS2008 installs an instance of SQL Server Express called .\SQLEXPRESS (even if you tell it not to it would seem), as well as some form of the client tool components (but not what you need for managing multiple servers). Here is a link to a great blog post that explains how to extricate yourself from this situation:
http://tiredblogger.wordpress.com/2007/05/11/installing-sql-server-2005-tools-after-visual-studio-orcas/
On Windows XP, I was able to get SQL Server 2005 Dev installed by following the instructions in the post to remove the pointless SQLEXPRESS instance, and then the client workstation components. This gets your machine back to the point where the Developer edition installer can run successfully.