I have produced a database in Visual Studio 2008 within an Application_Data folder of the MVC Web Application project. This leads to an mdf apply for the database that may be investigated within the Server Explorer tab. You may create a SQL script for changes you need to do towards the database.
So I am wondering the way you run these sql change scripts for an mdf-file in Visual Studio 2008? Or shall we be held forced to get this done through the SQL Management Studio Express application?
The syntax is:
CREATE DATABASE [databaseName]
This can produce a database around the SQL Server you're connected do, creating files using the standard names within the standard location. You will find additional options (described on MSDN) that may help you to put the database files elsewhere (including renaming them) if you want.
Obviously, you might use SQLCMD.
You skill is produce a Database Project* and fasten the project for your database. Database Projects are available under 'Other Project Types/Database' within the new project dialog. Should you then put the create script within the Database project you are able to run it really by right hitting the script in Solution Explorer and choosing Run.
*Database Projects are just obtainable in Visual Studio Professional Edition and above.