Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add a new database under app_data with SQL Server Enterprise Edition

Tags:

asp.net-mvc

I'm a absolute newbie in MVC, and now I am standing the beginning of it.

I checked out the tutorial podcast, in which i got i can add a new item of SQL Server database under app_data. But once I click that, a msg popup to show that in my desktop, no SQL Server 2005 or 2008 Express was installed.

But in fact, I have a SQL Server 2005 Enterprise installed already. Why this happened? And how to add a SQL Server database if I got a enterprise version?

Thanks a lot.

like image 623
Elaine Avatar asked Feb 27 '23 00:02

Elaine


1 Answers

Adding the database file to the app_data folder only works with SQL Server Express editions. There's nothing you can do to enable it for Enterprise versions.

If you have SQL Server Enterprise, you need to create your database and your db objects in that server (using SQL Server Mgmt Studio or Visual Studio) and connect to that server. You cannot put your MDF/LDF files into app_data with Enterprise version - it just won't work.

Or if you don't like this approach, you could always install SQL Server 2005/2008 Express on your machine and then use the "put your MDF file into app_data" approach with that Express edition.

like image 94
marc_s Avatar answered May 01 '23 08:05

marc_s