CLRF in SQL Server


Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in /home/paskov1/addon_domains/vmsoft-bg.com/paskov/root/wp-content/plugins/wp-syntax/wp-syntax.php on line 380

An interesting problem I was facing was adding CLRF on a string in SQL Server. The solution was to add a combination of chars ( CHAR(13) + CHAR(10) ) where the string should break the line. The follwing example will add CLRF in the string being updated.

UPDATE NM196 SET 
        OSNOVANIE = 
	'Вал. превод Реф.@@500' + CHAR(13) + CHAR(10) + 
	'сума @@547 @@502 @@542' + CHAR(13) + CHAR(10) + 
	'ориг.сума @@501' + CHAR(13) + CHAR(10) + 
	'вальор @@505 ' + CHAR(13) + CHAR(10) + 
	'Наредител: @@522 ' + CHAR(13) + CHAR(10) + 
	'Бенефициент: @@526 ' + CHAR(13) + CHAR(10) + 
	'Основание: @@535 @@546'
WHERE CODE = 295 AND NOMID = 196

Leave a Reply

Your email address will not be published. Required fields are marked *

*