将 MDF 文件导入 SQL Server 2008?

发布于 2024-08-01 16:19:00 字数 453 浏览 3 评论 0原文

我继承了一个 VB.net Web 应用程序,我正在对其进行一些更改。 我完全有能力进行编程(VB 和 MSSQL),但我对这些工具却迷失了方向。 我得到了一个包含代码和所有内容的 zip 文件。 我在 Visual Studio 2005 中打开了 sln 文件,只需稍作修改即可轻松运行。

运行该应用程序效果完美。 问题是,我需要编写一些新的 SP,因此需要数据库管理员。 SQL Server 2008 Express 已安装,但看不到任何数据库,我不知道如何导入它。

我的项目中有一个文件夹 App_Data,其中包含文件 ASPNETDB.MDF。 在VS中打开出现错误:

不支持此服务器版本。 您必须拥有 Microsoft SQL Server 2005 Beta 2 或更高版本。

有什么想法从这里去哪里吗?

I have inherited a VB.net web app that I'm making some changes on. I'm perfectly capable with the programming side (VB and MSSQL) but I'm getting lost with the tools. I was given a zip file of the code and everything. I opened the sln file in Visual Studio 2005 and it worked fairly easily with little modification.

Running the app works perfectly. Problem is, I need to write some new SPs so need the database admin. SQL Server 2008 Express is installed but it doesn't see any database and I have no idea how to import it.

I have a folder App_Data in the project with the file ASPNETDB.MDF. Opening this in VS gived the error:

This server version is not supported. You must have Microsoft SQL Server 2005 Beta 2 or later.

Any ideas where to go from here?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

倾听心声的旋律 2024-08-08 16:19:00

您需要获取 Sql Server Management Studio。 从那里,您应该能够连接到系统上运行的 Sql Server Express 实例,并告诉它附加到 .mdf 文件。 这将允许您通过 sql server 和 Management Studio 使用该数据库,并且您将能够添加存储过程。 请记住在完成后再次分离,否则您将无法按照应用程序的预期使用 mdf 文件。

You need to get Sql Server Management Studio. From there you should be able to connect to the instance of Sql Server Express running on your system and tell it to attach to the .mdf file. This will allow you to use that database from withing sql server and management studio, and you will be able to add your stored procedure. Just remember to detach again when you're done, or you won't be able to use the mdf file as you expect from your app.

微凉 2024-08-08 16:19:00

Visual Studio 使用 SMO 2005 连接到 SQL。 SMO 2005 按照设计不会连接到 SQL 2008。 您需要将 VS 升级到 VS 2008,或者将 Express 降级到 Express 2005。

Visual Studio uses SMO 2005 to connec to to SQL. The SMO 2005 will not connect to SQL 2008 by design. You need to either upgrade VS to VS 2008, or downgrade Express to Express 2005.

在梵高的星空下 2024-08-08 16:19:00

您无法将 SQL Server 2005 中创建的 mdf 文件附加到 SQL Server 2008 实例。 您需要的是安装 SQL Server 2005 Express,附加此文件,备份数据库,然后在 2008 Server 实例上还原它并分离数据库。 您将为 2008 Server mdf 正确创建。

You can't attach mdf file made in SQL Server 2005 to a SQL Server 2008 instance. What you need is to install SQL Server 2005 Express, attach this file, backup database, then restore it on 2008 Server instance and detach the database. You will get properly created for 2008 Server mdf.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文