First of you are going to need to download and install SubSonic
Once installed just follow the steps below
External tools
Title “SubSonic DAL”
command sonic.exe
arguments generate /out App_Code\Generated
Initial directory $(ProjectDir)
Prompt for arguments
use output window
scripting Schema and Data
You can script out your schema and data (and then version it in your favorite source control system) using SubCommander. Simply use the command “version” and tell SubCommander where to put the data:
sonic.exe version /out Scripts
This will output a script file (.sql) to the local scripts directory of your project
Generate a Version of the Database and Data
Title Subsonic DB
Command Sonic.exe
Arguments version /out App_Code\DB
Initial directory $(ProjectDir)