An app I'm working on is storing Unicode strings in an NVARCHAR(50)
column in an SQL Server 2005 database.
Sometimes, the database returns a string padded with spaces up to the max length of the column (50). At other times the padding doesn't happen.
I think that the type of this column was originally specified as NCHAR
, but that when we realized the spaces were being added, we changed it to NVARCHAR(50)
. Could this have anything to do with it?
Either way, can this 'feature' be turned off?
Clarification
I just realized that what I wrote above doesn't make it clear that even newly-inserted strings are getting padded with spaces.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…