SQL Server Compact有哪些限制? (或 - 如何选择数据库在MS平台上使用?) [英] What are the limitations to SQL Server Compact? (Or - how does one choose a database to use on MS platforms?)

查看:208
本文介绍了SQL Server Compact有哪些限制? (或 - 如何选择数据库在MS平台上使用?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用MS Visual C#Express(我愿意升级到Standard,如果需要的话)来构建需要数据库的应用程序。

The application I want to build using MS Visual C# Express (I'm willing to upgrade to Standard if that becomes required) that needs a database.

所有psyched关于SQL Server Compact - 因为我不想让谁的计算机上安装我的应用程序的人必须安装整个SQL Server或类似的东西。我希望这对于最终用户安装是尽可能容易。

I was all psyched about the SQL Server Compact - because I don't want the folks who would be installing my application on their computers to have to install the whole of SQL Server or something like that. I want this to be as easy as possible for the end user to install.

所以我都兴奋,直到它似乎有什么限制我可以做的列在我的表中。我创建了一个新的数据库,创建了一个表,当我去创建列似乎没有一个文本数据类型 - 只是一个名为ntext似乎限制为255个字符的东西。 int似乎限制为4(我想要11)。而且似乎没有auto_increment功能。

So I was all psyched until it seems that there are limitations to what I can do with the columns in my tables. I created a new database, created a table and when I went to create columns it seems that there isn't a "text" datatype - just something called "ntext" that seems to be limited to 255 characters. "int" seems to be limited to 4 (I wanted 11). And there doesn't seem to be an "auto_increment" feature.

这些是真正的限制吗? (或者是因为我使用快速而不是标准)。如果这些是真正的限制,我的其他数据库选项满足我的要求是什么? (容易安装的用户是biggie - 我假设我的最终用户只是计算机的一个普通用户,如果它的复杂会使我的应用程序感到沮丧)

Are these the real limitations I would have to live with? (Or is it because I'm using "Express" and not "Standard"). If these are the real limitations, what are my other database options that meet my requirements? (easy installation for user being the biggie - I'm assuming that my end user is just an average user of computers and if it's complicated would get frustrated with my application)

-Adeena

PS:我还希望我的数据库数据被加密到最终用户。我不希望他们直接访问数据库表。

PS: I also want my database data to be encrypted to the end user. I don't want them to be able to access the database tables directly.

PPS。我读过: http://www.microsoft.com/Sqlserver/2005 /en/us/compact.aspx ,但没有看到有关这些特殊限制的讨论

PPS. I did read: http://www.microsoft.com/Sqlserver/2005/en/us/compact.aspx and didn't see a discussion on these particular limitations

推荐答案

不确定加密,但您可能会发现此链接有用:

http://msdn.microsoft.com/en-us/library/ms171955.aspx

I'm not sure about encryption, but you'll probably find this link helpful:
http://msdn.microsoft.com/en-us/library/ms171955.aspx

至于其余部分:

文本和auto_increment提醒我访问。 SQL Server Compact应该与SQL Server的服务器版本兼容,因为您的压缩数据库中使用的查询和表应该转换为完整的数据库而不进行修改。考虑到这一点,您应该首先查看 SQL Server类型和名称而不是Access名称:在这种情况下 varchar(max) bigint identity 列。

As for the rest of it:
"Text" and "auto_increment" remind me of Access. SQL Server Compact is supposed to be upgrade compatible to the server editions of SQL Server, in that queries and tables used in your compact database should transfer to a full database without modification. With that in mind, you should first look at the SQL Server types and names rather than Access names: in this case namely varchar(max), bigint, and identity columns.

不幸的是,您会注意到,这相对于varchar(max)失败,因为精简版还没有varchar(max)类型。希望他们能很快解决。然而,你正在寻找的ntext类型支持多于255个字节:2 30 其实,超过5亿个字符。

Unfortunately, you'll notice this fails with respect to varchar(max), because Compact Edition doesn't yet have the varchar(max) type. Hopefully they'll fix that soon. However, the ntext type you were looking at supports many more than 255 bytes: 230 in fact, which amounts to more than 500 million characters.

最后,bigint使用8个字节进行存储。你问了11.但是,我想你可能会感到困惑,存储大小表示可用的小数位数。这绝对不是这样。 8字节的存储允许最多2个 64 的值,这将容纳超过11个数字。如果你有这么多的项目,你可能想要一个服务器类数据库。如果你真的想用数字来思考,还有一个数字类型。

Finally, bigint uses 8 bytes for storage. You asked for 11. However, I think you may be confused here that the storage size indicates the number of decimal digits available. This is definitely NOT the case. 8 bytes of storage allows for values up to 264, which will accomodate many more than 11 digits. If you have that many items you probably want a server-class database anyway. If you really want to think in terms of digits, there is a numeric type provided as well.

这篇关于SQL Server Compact有哪些限制? (或 - 如何选择数据库在MS平台上使用?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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