tony.sawyer (7/16/2010)
The ANSI_PADDING affects the CHAR types too - surprised the hell out of me when I finally discovered why my tables weren't linking!doing a simple
select '<' + prod_code + '>' from ...
showed it to only contain 7 characters with no trailing white space.
select '<' + cast(prod_code as char(10)) + '>' from ...
showed up the trailing 3 spaces (and then allowed EF4 to link the data to another table that had ANSI_PADDING set to ON)We're using SQL Server 2005 here - give it a shot and see if you get the same results
Tony,
You are correct. The difference is that unicode (nchar/nvarchar) always behave with ANSI_PADDING ON settings.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question