数据库项目部署流程

发布于 2025-01-03 04:38:02 字数 422 浏览 0 评论 0原文

我试图了解数据库项目如何在 Visual Studio 中工作。这是我到目前为止所做的:

  1. 在 SQL Management Studio 中创建了 SQL Express 2008 数据库。 (我可以在 Visual Studio 的服务器资源管理器中看到数据库和表)
  2. 在 Visual Studio 中创建一个数据库项目,并从我之前创建的数据库中导入对象。

现在我陷入困境,当我尝试部署在 Visual Studio 中所做的更改时,出现错误:

文件“blah blah.mdf”无法被覆盖。它正在被数据库“blah”使用

我的最终目标是在 Visual Studio 中拥有该数据库,这样我就可以将其添加到版本控制下,并部署团队中任何人对本地数据库所做的更改。

I am trying to understand how database projects work in Visual Studio. Here is what I have done so far:

  1. Created an SQL Express 2008 database in SQL Management Studio. (I can see the database and the tables in Server Explorer in Visual Studio)
  2. Created a database project in Visual Studio and imported the objects from the database I previously created.

Now I'm stuck, when I try to deploy changes I made in Visual Studio I get an error:

The file 'blah blah.mdf' cannot be overwritten. It is being used by database 'blah'

My end goal is to have the database in Visual Studio so I can add it under version control and deploy changes anyone in the team makes to the local database.

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

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

发布评论

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

评论(1

自此以后,行同陌路 2025-01-10 04:38:02

删除 Schema Objects\Database Level Objects\Storage\Files 下的文件修复了该错误。

Deleting the files under Schema Objects\Database Level Objects\Storage\Files fixed the error.

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