declare @string nvarchar(MAX) = ''
How many chars are available in @string?
nvarchar(MAX) will hold up to 2GB which is about 1 billion characters since it is unicode
in your case it is 0
also take a look at this, datalength counts storage, len counts characters, for varchar these will be the same
declare @string nvarchar(MAX) = ''
select datalength(@string), LEN(@string)
GO
declare @string nvarchar(MAX) = '1'
select datalength(@string), LEN(@string)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With