September 28, 2010 at 3:02 am
David Data (9/28/2010)
OTOH I designed our ETL system with [Postcode] [nvarchar](10) and then had to change it when I found records with postcodes like 'If out please leave by back door or with neighbour at No. 127' 🙁
I really hope your design change was to add a column for "delivery comments", not to increase the maximum length for the postcode. (Unless your business operates in a country where 'If out please leave by back door or with neighbour at No. 127' is a valid postcode).
But I do hope you changed the postcode to varchar(10). As far as I know, all countries in the world that use postal codes limit them to numbers and the letters A-Z.
September 30, 2010 at 10:05 pm
David Data (9/27/2010)
But I am curious as to why a VARCHAR(MAX) string that happens to contain say 100 chars is so much slower that a VARCHAR(100) that does? Its index and length values will have to be 32 bit numbers, but with 32/64 bit CPUs anything shorter tends to be less rather than more efficient anyway. As even a VARCHAR(100) is stored as a variable length string, I would not imagine the memory management issues are much different either. Or are they?
Im not sure. Some folks insist (and maybe rightfully so... I seem to remember such a thing in BOL but don't remember for sure) the VARCHAR(MAX) stays "inrow" under such conditions. To me, it seems like it may not but I've not taken the time to research that to any depth. It would be nice to know for sure but I just don't have the floor space on my dance card right now.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 2 posts - 31 through 31 (of 31 total)
You must be logged in to reply to this topic. Login to reply