• kcj (4/16/2015)


    I have two string variables each has Varchar(8000)

    Declare @VariableA varchar(8000)

    Declare @VariableB varchar(8000)

    How can I concatenate these two variables without converting them to varchar(max) ?

    If try select @VariableA + @VariableB , I only got 7999 characters…

    I am not sure why.. how can i fix this issue

    Thank you

    You cannot do it!

    Quick question, how long are the character strings stored in those variables?

    😎

    You are right, no other option for a character type variable larger than 8000 bytes exists but the (MAX) (apart from old deferred and about to be discontinued blob types), so why no just use that, any input to other 8K or less in size is going to be truncated at the variable's declaration length.