concatenating 2 rtf fields stored in blobs with a

2019-09-02 18:35发布

I need to concatenate 2 rtf fields stored in 2 separate blob columns (actually they are nvarbinary(max) in sql server).

I need to do this with a database script, not in an application.

Is there a way? Or the only solution is to remove all the rtf headers, concatenate the "body" of the 2 fields and then recreate the headers?

By headers I mean

\rtf1\ansi\ etc...

1条回答
做个烂人
2楼-- · 2019-09-02 19:08

If you can cleanly remove the headers and fix any CRC/length issues, then a simply string concat (which is valid for binary types too) will do it

eg

NewFixedHeader + HeaderlessnNarbinarymaxcolumn1 + HeaderlessNvarbinarymaxcolumn2

Although, this isn't really a SQL thing at all...

查看更多
登录 后发表回答