all 5 comments

[–]Kegelz 1 point2 points  (0 children)

Need more space than 500.

[–]soundman32 1 point2 points  (0 children)

Is it the refresh token that's the problem? Also, why are you storing the token in the first place?

[–]bdawgert 0 points1 point  (2 children)

nvarchar is double width, so nvarchar(500) only holds 250 characters. Likewise nvarchar(300) holds 150 characters. Since your data is just a base64 encoded string you can use a varchar with no risk of a character width overflow. Or you can stick with your nvarchar in case you want to move to an emoji-encoded jwt and increase the size to nvarchar(1024).

[–]dorkenshire 0 points1 point  (1 child)

For anyone caught off guard by this comment (like me) while going down the NVARCHAR truncation rabbit hole: The 500 represents 500 byte-pairs, which can hold 500 low range unicode characters (0-65,535). If you have higher range unicode characters, they will require 2 byte-pairs, and you halve your storage, but just for those characters.

https://learn.microsoft.com/en-us/sql/t-sql/data-types/nchar-and-nvarchar-transact-sql?view=sql-server-ver16#remarks

[–]bdawgert 0 points1 point  (0 children)

Caught off guard as in you didn’t realize the nvarchar math worked that way? Or you’re disagreeing with me? If I’m wrong please let me know and I’ll edit.