I'm getting unexpected results with a very simple bit of SQL, on Sybase.
declare @mystring char(30)
select @mystring = 'abc'
select 'mystring = ' + @mystring
select @mystring = @mystring + 'xyz'
select 'mystring = ' + @mystring
This returns:
mystring = abc
mystring = abc
Why doesn't the last select return 'abcxyz' ?
Thanks
Bob
I suspect that this is because you have declared @mystring as char(30) and All CHAR values are blank padded up to max-length
Declaring it as varchar(30) will do the trick :
declare @mystring varchar(30)
select @mystring = 'abc'
select 'mystring = ' + @mystring
SELECT @mystring = @mystring + 'xyz'
select 'mystring = ' + @mystring
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With