Hosting Support Language
 
HomeKnowledge BaseWeb DevelopmentSQL Server DatabasesXCopy Deployment of SQL Server Databases
Information
Article ID18
Created On12/14/2008
Modified12/14/2008
XCopy Deployment of SQL Server Databases
SQL Server Express 2005 and above supports a feature called 'User Instances' that allows keeping a Database file in the App_Data folder and dynamically attaching it at runtime.

This feature has security implications that makes it unsafe in shared hosting environment. Furthermore, since we host SQL Server databases on a dedicated server separate from the Web Server, uploading database files into the hosting space (which is on the Web Server) won't make it accessible to the Database server.

For these reasons, copying SQL Server database files into your hosting space (XCopy deployment) is not an option and you must create and deploy SQL Server databases on the Database Server.

However, you can use SQL Server Compact Edition if you would like to have the convenience of XCopy deployment. The SQL Server Compact Edition (CE) is a single file, in-memory (driver loaded in memory, no external service required) database that offers most features of SQL Server (Except Stored Procedure, Views and Triggers) with a file size limitation of 4GB. You can use SQL Management Studio Express to manage SQL CE Databases.

NOTE: By default SQL Compact Edition does not work with ASP.NET. To enable SQL CE support, you must use the following code before connecting to the Database:

AppDomain.CurrentDomain.SetData("SQLServerCompactEditionUnderWebHosting", true);



For small scale Web applications not intended to support many concurrent users, SQL CE makes a viable option. But for any serious development, you should consider full scale database like SQL Server or MySQL