C# 如果我的软件使用它,我是否必须在每个客户端上安装 sql server?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11481663/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Do I have to install sql server on each client if my software uses it?
提问by Razort4x
If we develop some software in c# (or basically .Net), we don't install visual studio to any client. The client just have to have required .Net framework (1.0, 1.1, 2.0, 3.0 etc) installed and we are good to go.
如果我们用 c#(或基本上是 .Net)开发一些软件,我们不会将 Visual Studio 安装到任何客户端。客户端只需要安装所需的 .Net 框架(1.0、1.1、2.0、3.0 等),我们就可以开始了。
Same way, if we are making making an app in VC2008, he just needs to have Visual C++ 2008 runtime (available from MS site free, about 4-5Mb). So, basically, we just need runtime environment. but there isn't any SQL server 2008 runtime (or I am not aware of it?).
同样,如果我们在 VC2008 中制作应用程序,他只需要有 Visual C++ 2008 运行时(可从 MS 站点免费获得,大约 4-5Mb)。所以,基本上,我们只需要运行时环境。但是没有任何 SQL Server 2008 运行时(或者我不知道它?)。
So, my question is if my software is using SQL Server 2008, what runtime (or anything else) will be required on client side for it to work?
所以,我的问题是,如果我的软件使用 SQL Server 2008,客户端需要什么运行时(或其他任何东西)才能工作?
Also, one more thing, I see there is an SQL Server express edition, which I can supposedly use in deployment, but it seems kinda heavy knowing that if my software if just 5, 10 or 20Mb I need to install about a gig just so user can run it.
另外,还有一件事,我看到有一个 SQL Server express 版本,我应该可以在部署中使用它,但是如果我的软件只有 5、10 或 20Mb,我需要安装大约一个演出,这似乎有点沉重用户可以运行它。
Lastly, if I am using SQL Server 2008 Developer Edition (which I am, or enterprise one not sure) and I installed SQL Server express on client, wouldn't it cause some problem if my software uses some features that are not supported in express edition? (say number of database, or concurrent connection, or anything).
最后,如果我使用的是 SQL Server 2008 Developer Edition(我是,或者企业版不确定)并且我在客户端上安装了 SQL Server express,如果我的软件使用了 express 不支持的某些功能,会不会导致一些问题版?(说数据库的数量,或并发连接,或任何东西)。
So? What runtime is required for it? And if installing sql server express is the only option, what if I am using some features that are not supported in express edition? Surely, I can't go on doing a full install of developer edition on each client!
所以?它需要什么运行时?如果安装 sql server express 是唯一的选择,如果我使用了一些 express 版本不支持的功能怎么办?当然,我不能继续在每个客户端上完全安装开发人员版!
EDIT:In case this is of any help, my current project is a library management system, and it will be installed the client (the computer of the librarian for whom I am making this), so there is no case of server-client here. So should I install sql express on his computer? Also, as YvesRpointed out in his answer, that link only shows three editions (main ones), but http://msdn.microsoft.com/en-us/library/cc645993%28v=SQL.110%29.aspxshows more detailed comparison. So, in this particular scenario that I just described, would it be sufficient if I just deployed and express edition on client's machine?
编辑:如果这有任何帮助,我当前的项目是一个图书馆管理系统,它将安装客户端(我为之制作的图书馆员的计算机),所以这里没有服务器客户端的情况. 那我应该在他的电脑上安装sql express吗?此外,正如YvesR他在回答中指出的那样,该链接仅显示三个版本(主要版本),但http://msdn.microsoft.com/en-us/library/cc645993%28v=SQL.110%29.aspx显示更多详细对比。那么,在我刚刚描述的这个特定场景中,如果我只是在客户端机器上部署和表达版本就足够了吗?
Now, about what I said about some functions not being available in express edition, http://msdn.microsoft.com/en-us/library/cc645993(v=SQL.110).aspx#CrossBoxScaleshows that express edition is limited to a database of size 10Gb, now I know that is more than enough in the scenario I described above, but what if in some other case I need more than that? Than express edition won't do it, than how should I deploy?
现在,关于我所说的某些功能在 Express 版中不可用, http://msdn.microsoft.com/en-us/library/cc645993(v=SQL.110).aspx#CrossBoxScale显示 Express 版是有限的到大小为 10Gb 的数据库,现在我知道这在我上面描述的场景中已经绰绰有余了,但是如果在其他一些情况下我需要更多呢?比快递版不行,比我应该如何部署?
Finally, http://www.microsoft.com/sqlserver/en/us/get-sql-server/how-to-buy.aspxshows two more edition, Compact and Developer, I know about developer but what is this compact edition? And more importantly, why are these not comared or listed here?
最后,http://www.microsoft.com/sqlserver/en/us/get-sql-server/how-to-buy.aspx显示了另外两个版本,Compact 和 Developer,我知道 developer,但是这个 Compact 版本是什么? 更重要的是,为什么这里没有列出或列出这些?
Edit 2:Its 4Gb, the limit, not 10Gb. 10Gb is in SQL Server 2008 R2 Express and above, 4Gb in SQL Server 2008 Express.
marc_s: Thanks for that!
编辑 2:它的 4Gb,限制,而不是 10Gb。SQL Server 2008 R2 Express 及更高版本中为 10Gb,SQL Server 2008 Express 中为 4Gb。
marc_s:谢谢!
采纳答案by YvesR
If you use a SQL Server database to persist your data in your application you need
如果您使用 SQL Server 数据库将数据保存在应用程序中,则需要
a. client-server infrastructure where your client connect to a central SQL Server via LAN
一种。客户端-服务器基础结构,您的客户端通过 LAN 连接到中央 SQL Server
b. or use a client installed sql server edition (which is what you want I guess). For this you can use SQL Server Express edition or just a MSDE (Desktop Edition).
湾 或者使用客户端安装的 sql server 版本(我猜这就是你想要的)。为此,您可以使用 SQL Server Express 版或仅使用 MSDE(桌面版)。
See for more details e.g. this blog post http://searchsqlserver.techtarget.com/tip/SQL-Server-2005-Express-vs-Desktop-Engine-MSDEor google for it, plenty of information from MS itself about MSDE.
有关更多详细信息,请参阅此博客文章http://searchsqlserver.techtarget.com/tip/SQL-Server-2005-Express-vs-Desktop-Engine-MSDE或谷歌搜索,MS 自身提供的大量关于 MSDE 的信息。
EDIT: Since 2012 there is no more MSDE, but SQL Server 2012 Express brings a mode like MSDE did. See here: http://www.microsoft.com/sqlserver/en/us/editions/2012-editions/express.aspx
编辑:自 2012 年起不再有 MSDE,但 SQL Server 2012 Express 带来了像 MSDE 那样的模式。请参见此处:http: //www.microsoft.com/sqlserver/en/us/editions/2012-editions/express.aspx
And as you can see here: http://www.microsoft.com/sqlserver/en/us/editions.aspx, there shouldn't be a function that you use that isn't available for a desktop application imho.
正如您在此处看到的:http: //www.microsoft.com/sqlserver/en/us/editions.aspx,不应该有您使用的功能不适用于桌面应用程序恕我直言。
回答by BrokenGlass
There is no client runtime required for database access besides the .NET framework installed (which you need for all .NET executables anyway).
除了安装的 .NET 框架(无论如何,所有 .NET 可执行文件都需要)之外,数据库访问不需要客户端运行时。
If you want the database to reside on the same machine as the client free options would be e.g. SQL Server Express or SQLite.
如果您希望数据库与客户端免费选项位于同一台机器上,例如 SQL Server Express 或 SQLite。
回答by tom redfern
OK let's back up a bit. Do you have a requirement for each of your software clients to have it's own local database? If this is the case there are far simpler ways of storing data on the client (I would suggest serialization to file as one approach).
好的,让我们备份一下。您是否要求每个软件客户端都拥有自己的本地数据库?如果是这种情况,在客户端上存储数据的方法要简单得多(我建议将序列化到文件作为一种方法)。
If your requirement is to have each client connect through to a central database then you don't need any runtime components other than the .net core libraries.
如果您的要求是让每个客户端连接到中央数据库,那么除了 .net 核心库之外,您不需要任何运行时组件。
回答by Shamal Sabah
Here are two ways for Windows Applications:
以下是 Windows 应用程序的两种方法:
Desktop application that will be used by each clients separately without assigning a computer as server. You only need to install
SSMSand the application for your Clients. The Update/Delete/Insert operations will be done separately.Client-Server Approach, install
SSMSand attach your DB on a computer. This computer will serve your clients as a server. Then install the exe file on any client computer, make sure the clients are connected to the server using the IP.
由每个客户端单独使用的桌面应用程序,无需指定计算机作为服务器。您只需要
SSMS为您的客户安装应用程序。更新/删除/插入操作将单独完成。客户端 - 服务器方法,
SSMS在计算机上安装和附加您的数据库。这台计算机将作为服务器为您的客户提供服务。然后在任何客户端计算机上安装 exe 文件,确保客户端使用 IP 连接到服务器。

