Sample Header Ad - 728x90

Are duplicated NVARCHAR values stored as copies in SQL Server?

7 votes
6 answers
1965 views
I'm designing a table that will contain a lot of rows. So need to be careful not to store to much information. One of the columns is a NVARCHAR(MAX) column and it contains the address of our customers. As addresses do not change often, this column will contain many repeated values and thus contains quite some redundancy. So I was wondering if I need to normalize this myself by maintaining some sort of look-up table to address strings (note that if an address changes I need to maintain history - so it's not a matter of usual normalization), or if SQL Server is pointing to the same reference of the string behind the scenes. Or maybe it offers a column option to do so. Another approach that came into my mind is to use COMPRESS but I guess this does not make sense as the data itself (i.e. the address) is not long. Reading/writing performance is not so much of a concern as the data will be accumulated over time.
Asked by Dejan (175 rep)
Nov 18, 2020, 09:49 AM
Last activity: Jun 26, 2023, 02:34 PM