如何生成与Advantage Database Server相同格式的GUID字符串?(How to generate a GUID string in the same format as Adva

系统教程 行业动态 更新时间:2024-06-14 17:02:18
如何生成与Advantage Database Server相同格式的GUID字符串?(How to generate a GUID string in the same format as Advantage Database Server?)

我有一个优势数据库V11,其中我使用NewIDString('F')存储一个唯一标识符,该标识符是一个长度为22个字符的GUID字符串。

ADS帮助的片段如下: -

“F或File - 使用File和URL Safe base64编码将GUID编码为22个字节的字符串,格式为xxxxxxxxxxxxxxxxxxxxxx。Base64编码的字符串区分大小写,不应存储在不区分大小写的字符串字段中。

是否可以在Microsoft SQL中生成相同的格式GUID字符串?

如果没有,ADS帮助文件列出了如下其他格式: -

NEWIDSTRING返回格式为字符串的GUID。 如果未指定格式参数,则GUID字符串将被格式化为十六进制字符串,其格式为xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx。 format参数可以是以下值:

M或MIME - 使用格式为xxxxxxxxxxxxxxxxxxxxxxxx的MIME base64编码编码为24字节字符串的GUID。 Base64编码的字符串区分大小写,不应存储在不区分大小写的字符串字段中。

F或文件 - 使用文件和URL安全base64编码编码为22字节字符串的GUID,格式为xxxxxxxxxxxxxxxxxxxxxx。 Base64编码的字符串区分大小写,不应存储在不区分大小写的字符串字段中。

N或Numbers - GUID编码为格式为xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx的32字节十六进制字符串值。

D或Delimited - 编码为32字节十六进制字符串的GUID,格式为xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx。

B或Bracketed - 编码为32字节十六进制字符串的GUID,格式为[xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx]

P或括号 - 编码为32字节十六进制字符串的GUID,格式为(xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)

C或Curlybraces - 一种GUID,编码为32字节的十六进制字符串,格式为{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}

MS-SQL可以生成其中一个吗?

问候

麦克风

I have an advantage database V11 in which I currently store a unique identifier which is a GUID string generated 22 characters long using NewIDString('F').

The snippet from the ADS help is as follows :-

"F or File – A GUID encoded as a 22-byte string using File and URL Safe base64 encoding with the format of xxxxxxxxxxxxxxxxxxxxxx. Base64 encoded strings are case sensitive and should not be stored in case insensitive string fields."

Is it possible to generate the same format GUID string in Microsoft SQL?

If not, the ADS Help file lists other formats as follows :-

NEWIDSTRING Returns a GUID formatted as a string. If the format parameter is not specified, the GUID string is formatted as a hexadecimal string with the following pattern xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. The format parameter can be the following values:

M or MIME – A GUID encoded as a 24-byte string using MIME base64 encoding with the format of xxxxxxxxxxxxxxxxxxxxxxxx. Base64 encoded strings are case sensitive and should not be stored in case insensitive string fields.

F or File – A GUID encoded as a 22-byte string using File and URL Safe base64 encoding with the format of xxxxxxxxxxxxxxxxxxxxxx. Base64 encoded strings are case sensitive and should not be stored in case insensitive string fields.

N or Numbers – A GUID encoded as a 32-byte hexadecimal string value with a format of xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.

D or Delimited – A GUID encoded as a 32-byte hexadecimal string with a format of xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.

B or Bracketed – A GUID encoded as a 32-byte hexadecimal string with a format of [xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx]

P or Parenthesis – A GUID encoded as a 32-byte hexadecimal string with a format of (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)

C or Curlybraces – A GUID encoded as a 32-byte hexadecimal string with a format of {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}

Can MS-SQL generate one of these?

Regards

Mike

最满意答案

在SQL SerVer中, NEWID函数创建新的GUID(SQL Server数据类型称为UNIQUEIDENTIFIER )。 一个GUID是一个二进制值,你在问题中提到的各种格式就是这样,只是二进制值的不同字符串表示形式。 在NEWID的MSDN页面中,示例A将GUID的标准字符串表示形式显示为XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX。

In SQL SerVer the NEWID function creates new GUIDs (the SQL Server data type is called UNIQUEIDENTIFIER). A GUID is a binary value, the various formats you mention in your question are just that, merely different string representations of the binary value. In the MSDN page for NEWID example A shows the standard string representation of a GUID as XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX.

更多推荐

本文发布于:2023-04-21 18:49:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/de149332d6be17bb9005804f4f749dcb.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字符串   格式   Server   Database   Advantage

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!