SQL Server 2008 和 SQL Server 2008国际货币

发布于 2024-11-24 21:27:07 字数 221 浏览 2 评论 0原文

我构建的应用程序由我们的组织在全球范围内使用,并且需要支持多种不同的货币。 SQL Server 可以很好地处理“正常”的内容,即英镑符号、欧元符号,但是当我引入沙特里亚尔 (SAR) 符号时,它会将其存储为问号。

客户端是 100% jQuery/javascript,与支持 REST 的 WCF 服务配合使用。

我遇到了一些关于 LocaleID

希望有人能对此有所启发。

An application that I've built is used worldwide by our organization and needs to support several different currencies. SQL Server was doing fine with the 'normal' stuff i.e. the GBP symbol, Euro symbol, but when I introduced the symbol for the Saudi Riyal (ريال SAR), it stores it as question marks.

Client-side is 100% jQuery/javascript working with REST-enabled WCF services.

I ran across something talking about the LocaleID here

Hoping someone can shed some light on this.

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

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

发布评论

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

评论(1

贱人配狗天长地久 2024-12-01 21:27:07

将字符串格式化为 nVarchar。如果它们位于表的字段中,请更改数据类型。如果它们只是动态格式化,请使用 N 前缀。 nVarchar 是unicode,它是一种扩展的国际字符集。

示例:

SELECT 'ريال'

select N'ريال'

在我的系统上,第一个显示 ??????,第二个正确显示符号。

编辑

如果字符输入为varchar,您仍然会遇到问题。

请参阅下面的示例:

DECLARE @t nvarchar(10) = N'ريال'
DECLARE @x nvarchar(10) = 'ريال'

SELECT @t
SELECT @x

Format your strings as nVarchar. If they are in fields in a table, change the datatype. If they are just formatted on the fly, use the N prefix. nVarchar is unicode, which is an expanded international character set.

Example:

SELECT 'ريال'

select N'ريال'

On my system, the first shows ????, the second shows the symbol correctly.

EDIT

If the characters were entered as varchar you will still have issues.

See example below:

DECLARE @t nvarchar(10) = N'ريال'
DECLARE @x nvarchar(10) = 'ريال'

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