concatenating 2 rtf fields stored in blobs with a sql script

只愿长相守 提交于 2019-12-24 23:32:11

问题


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:


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...



来源:https://stackoverflow.com/questions/3108985/concatenating-2-rtf-fields-stored-in-blobs-with-a-sql-script

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!