Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>All SQL Server Databases are <code>.mdf</code> files. The <code>.mdf</code> files are stored here: <strong>*C:\Program Files\Microsoft SQL Server\MSSQL\Data*</strong> (Default Location).</p> <p>You are correct that you would have to detach the SQL Database from the server to move the database to your App_Data folder. You can do that by right clicking on the database in SSMS.</p> <p>The advantages of moving the database to the App_Data folder is if:</p> <ol> <li>The database will be kept there when used in production and you will attach the database to a SQL Server dynamically when you connect to it.</li> <li>You want to publish the website to your server together with the mdf in the App_Data folder (which goes together with the first reason).</li> <li>Keeping all of you project files in one location. Easy to move. Easy to Backup.</li> </ol> <p>In your scenario where you will be uploading your database via a custom control panel, I don't see any advantages to moving the database to the App_Data folder. When you publish the site you can simply detach the DB, grab the mdf file and upload (Your control panel may have other ways to import a DB, e.g. SQL scripts...).</p> <p>To answer you questions directly...</p> <blockquote> <p>Does it make sense to move my SQL Server DB out of SQL Server and into the App_Data directory as an .mdf file?</p> </blockquote> <p>I don't think so.</p> <blockquote> <p>If so, how can I move it?</p> </blockquote> <p>Detach. You can do that by right clicking on the database in SSMS.</p> <blockquote> <p>Are there any performance/security issues that can occur with a .mdf file like this?</p> </blockquote> <p>I am not sure about security differences but as mentioned there is probably better performance when the database is left attached to the SQL Server.</p> <blockquote> <p>Would my intended setup work OK with a typical virtual hosting plan?</p> </blockquote> <p>You would have to check if they count/allow sql databases to be attached dynamically.</p> <p>I hope this helps. I am no expert.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload