Reputation: 5640
We have got a big table with hundreds of thousands of rows, and say, 20, columns. One of the columns is of type nvarchar(30)
. If I change this to nvarchar(256)
, because a few of the rows need to store more data there, but not all, then:
I tried to google this but only found comparisons of nvarchar(n)
with nvarchar(MAX)
. Please note that my scenario does not include out-of-row storage, as far as I can tell.
Upvotes: 0
Views: 1360
Reputation: 239664
That should be a metadata only change - rows only consume as much storage for variable length data as they actually require. So an nvarchar(256)
column where no row actually contains more than 30 characters will consume exactly as much disk space as an nvarchar(30)
column.
Upvotes: 2