有一个图像字段,并希望从十六进制字符串中插入:
insert into imageTable(imageField)
values(convert(image, 0x3C3F78...))
Run Code Online (Sandbox Code Playgroud)
但是当我运行select时,返回值为0,另外0为0x03C3F78 ...
这个额外的0导致另一个应用程序出现问题,我不想要它.
如何阻止添加额外的0?
架构是:
CREATE TABLE [dbo].[templates](
[templateId] [int] IDENTITY(1,1) NOT NULL,
[templateName] [nvarchar](50) NOT NULL,
[templateBody] [image] NOT NULL,
[templateType] [int] NULL)
Run Code Online (Sandbox Code Playgroud)
并且查询是:
insert into templates(templateName, templateBody, templateType)
values('I love stackoverflow', convert(image, 0x3C3F786D6C2076657273696F6E3D.......), 2)
Run Code Online (Sandbox Code Playgroud)
实际的十六进制字符串非常大,可以在这里发布.