使数据库mdf在不同的计算机上工作 [英] Making database mdf work across different computers

查看:71
本文介绍了使数据库mdf在不同的计算机上工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这是一个愚蠢的问题,但这给我带来了很多问题.当我们彼此发送Visual Studio项目时,我和我在大学项目中的合作伙伴有很多问题使数据库mdf正常工作.它为我们提供了有关sql server版本的错误.唯一的解决方案是为整个团队安装相同版本的sql服务器,还是有其他解决方法?

I know this is kind of a stupid question but it gives me a lot of problems. Me and my partners in college projects have a lot of issues making the database mdf work when we send each other the visual studio projects. It gives us errors about the versions of sql server. Is the only solution to this to install same version of sql servers for the entire team or is there some other workaround?

推荐答案

是的,您必须在所有PC上使用相同版本的SQL Server.

Yes, you must be using the same version of SQL Server across all PC's.

一旦将 .mdf 文件附加到给定文件中,您就可以及时 从不 使用SQL Server数据库进行返回".版本,则可以 不再 附加到旧版本.而且,您也不能通过使用数据库兼容性级别来解决此问题-内部数据库文件结构在各个版本之间差别太大,并且没有提供向后的降级"路径.

You can never "go back" in time with a SQL Server database - once a .mdf file has been attached to a given version, it can never be attached to an older version anymore. And you cannot get around this by using the database compatibility level, either - the internal database file structures are just too different between versions, and no backwards "downgrade" path is provided.

解决此问题的一种方法是在每个人都可以连接且每个人都可以使用的地方拥有一个公用的共享服务器-从而不必发送自由浮动"的 .mdf 文件...毕竟,它是SQL 服务器-一种基于基于服务器的系统-与其说是基于文件的数据库"系统....

One way to get around this would be to have a common, shared server somewhere that everyone can connect to and everyone can work with - making in unnecessary to send around "free-floating" .mdf files altogether... after all, it's SQL Server - a server-based system - not so much a file-based "database" system ....

另一种可行的方法是停止共享 binary .mdf 文件,而是使用可以在其中交换的 SQL脚本您的团队,并且每个团队成员都可以在各自的SQL Server实例上本地执行-不管他们的本地版本是什么

Another way to go would be to stop sharing the binary .mdf file, but instead work with SQL scripts that you can exchange within your team, and that each team member can execute locally on their respective SQL Server instances - regardless of their local version

这篇关于使数据库mdf在不同的计算机上工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆