Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Accumulating in a local variable
Message
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Miscellaneous
Thread ID:
00662107
Message ID:
00662138
Views:
23
Or
SET @txt = @txt + ISNULL(@txtaux, '')
BTW, SET CONCAT_NULL_YIELDS_NULL controls how null value is treated in concatenation.

>Thank you Michael and Sergey:
>
>The problem was that exist an NULL value in field 'texto' and the solution was include an IF asking for a NULL value.
>Apparently command '+' doesn't concatenate when it finds a value NULL and it loses (?) the current content.
>
>
>	WHILE @@FETCH_STATUS = 0
>	BEGIN
>		FETCH NEXT FROM cur_text INTO @txtaux
>		IF @txtaux IS NOT NULL
>			SET @txt = @txt + @txtaux
>	END
>
>	PRINT 'Complete string: ' + @txt
>
>
>>Sergey pointed out one problem - you've got the FETCH in the wrong place within
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform