I'm trying to do this:
DECLARE @myVar VARCHAR(MAX)
Loop with cursor
select @myVar = @myVar + bla bla bla
end loop
When the loop ends, @myVar is incomplete, containing only 8000 characters.
I have tryed to use text, but is not allowed to local vars.
What would be a good solution to this case?
xml var?
I have just looked this posts:
How do I pass a string parameter greater than varchar(8000) in SQL Server 2000?
Check if concatenating to a varchar(max) will go beyond max allowable characters
And others through the web.
Regards.