Jack Corbett (9/12/2008)
Bill,I'm not sure what you are exactly asking. Are you mentioning that if you just run the Selects you have listed in SSMS you get the same results?
When I run:
Select 'A' + 'A', 'A ' + 'A'
I get:
no_space one_space
-------- ---------
AA A A
I would guess that is because the QP is treating the literals as CHAR not VARCHAR.
Also SSMS connects to the server with ANSI_PADDING ON in the settings by default, you have to explicitly set it to off.
I was just trying to recreate your results but no matter what I do in SQL80 QA when run against a SQL90 DB instance I alway get the same padded result. Manipulating ANSI_PADDING at the session level appears to be ignored.
Select 'A' + 'A', 'A ' + 'A'
no_space one_space IS ALWAYSTHE RESULT
-------- ---------
AA A A