March 17, 2016 at 12:34 pm
If I have a user entry field that could hold a bible of information and could have formatted text (carriage returns, tabs, special characters, etc) - what is the best data type to use for this? Should I use a "text" data type? Does that store formatting?
March 17, 2016 at 12:42 pm
The text data type is deprecated. You should use Nvarchar(max).
March 17, 2016 at 2:47 pm
FridayNightGiant (3/17/2016)
The text data type is deprecated. You should use Nvarchar(max).
I would only use nvarchar(max) if I needed to store Unicode data. If there is no need for Unicode data then I would use varchar(max).
March 17, 2016 at 3:36 pm
True, the poster mentioned special characters which I assumed to mean Unicode
March 17, 2016 at 4:43 pm
FridayNightGiant (3/17/2016)
True, the poster mentioned special characters which I assumed to mean Unicode
Not all special characters are Unicode.
March 21, 2016 at 8:00 am
Ok thanks, sorry for the late reply.
How big is nvarchar(max)? I know it says 2 to the 31st power or something... but I'm a dumb dumb and I don't really "get" that. I assume that's really really big?
March 21, 2016 at 8:16 am
amy26 (3/21/2016)
Ok thanks, sorry for the late reply.How big is nvarchar(max)? I know it says 2 to the 31st power or something... but I'm a dumb dumb and I don't really "get" that. I assume that's really really big?
2GB of text. Which is more than enough storage for the entire text of War and Peace. It should be WAY more than enough storage for any situation.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
March 21, 2016 at 11:41 am
Thank you for putting it into GB for me... I gets it now. 🙂
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply