Click here to Skip to main content
15,888,984 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
SQL 2008 R2 - What datatype do you pick for Alphanumeric data with a defined field length.
Posted

(n)varchar is most suitable for alphanumeric fields. Simple (n)char will pad text with spaces.
 
Share this answer
 
If, by alphanumeric data, you mean that you do not need anything else than simple standard western characters, without accentuation, typically only letters and numbers, then I would go for a char([your length]).

If not, then a nchar([your length]) could be appropriate.
 
Share this answer
 
v3
I don't know how to close a question once it's been answered?
 
Share this answer
 
Comments
CHill60 9-Oct-15 11:54am    
As the original poster you should apparently see a green tick next to the solution that solved your problem (you can indicate that more than one solution worked for you if you want to).
Failing that, don't worry about it.
[no name] 9-Oct-15 11:55am    
Accept the answer(s) you like and helped you. And in case an answer was helpfull you can also give an additional 5 stars ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900