How can we handle ascii characters using sql server 2005? Which data type can I use to store ascii characters, mainly control characters?
For example: I have a file with strings delimited by some control characters like backspace. I need to read this file into my sql server tables. I want to know what data type (char,nchar,varchar, ..) I can use to store them.
Also, all the string split functions I have seen work well with normal delimiters like ,. But my delimiter is backspace \b.
I know from this question that NVARCHAR will accommodate what you’re asking for, because it deals with how to get rid of non-printable ASCII characters.
You can use my answer in that question as a basis to replace the applicable characters with something that will work better with split/substring functions. A comma isn’t a great choice, because it will naturally occur in your data, but
~is pretty safe. The ~ is the character you get when you hold the shift key and press the key to the left of the [number] one key (assuming English QWERTY/etc).