且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

十六进制到ASCII字符串的转换

更新时间:2023-02-03 08:37:43

根据您的信息,此列来自Microsoft Dynamics导航,听起来确实很清楚.

According to your information, that this column is from Microsoft Dynamics NAV it sounds really clear.

MSDN文档表示了这一点:

指定链接附加到的记录.

Specifies the record that the link is attached to.

使用以下语法:

<表名&gt ;:<主键1>,<主键2>,<主键3>

我很确定,Microsoft为此值提供了一个组合模式,这有点奇怪,但是我想起来并不难.

I'm pretty sure, Microsoft has a combined schema for this value, which is a bit strange but well not that hard to fiddle out I think.

如果将值分割为 FF ,则可以看到两个结果:

If you split your values up to the FF, you can see two results:

--0xB6A1E6050089FF4252412D4D3032000000
select convert(int,0xB6A1E6050089FF) -- Object_ID for the specified table
select convert(varchar(100),0x4252412D4D3032000000) -- Primary Key 1

您可以尝试进一步并在您的计算机上执行此操作:

You can try to take this further and execute this on your machine:

select object_name(convert(int,0xB6A1E6050089FF))

这应该给您一个有效的表名.希望.;-)

This should give you a valid table name. Hopefully. ;-)

由于我没有安装这些系统,所以我不能自己检查这一点.如果是这样,我可以在此结果中添加一条简短的命令,以自动为您进行拆分.

I can't check this on my side, as I havent those system installed. If so, I can add a short command to this result to automate the splitting for you.

您的其他字符串可以这样分割:

Your other string can be splitted like this:

--0x1E150000008B000000000089FF534F3030303133353532000087102700000000
SELECT convert(int,0x1E150000008B000000000089FF) -- 35327 (object_id)
SELECT convert(varchar(100),0x534F30303031333535320000) -- SO00013552
SELECT convert(int,0x87102700000000) -- 0

我认为,您需要动态解析它.您应该检查基表(第一部分).之后,检查主键的顺序.选中此选项后,您可以将它们动态解析为它们的目标格式.唯一可能会更困难的是拆分的一部分.通常,第一部分应该一直到 FF .之后,每个部分都可以被多个零分割.

I think, you need to parse it dynamically. You should check the basetable (the first part). After that, check the primary keys in their ordering. After checking this, you can dynamically parse them into their target format. The only thing, which may be a bit harder, is the part of the splitting. Normally the first part should go until the FF. After that each part can be splitted by multiple zeros.