ntext size

User avatar
Jezza
5StarLounger
Posts: 847
Joined: 24 Jan 2010, 06:35
Location: A Magic Forest in Deepest, Darkest, Kent

ntext size

Post by Jezza »

Whilst aware that ntext is deprecated I am stuck with this from a legacy system.

In my SQL 2000 database I have a table with a field with the datatype ntext 16, does this mean the field length is 216? (65536)
Jerry
I’ll be more enthusiastic about encouraging thinking outside the box when there’s evidence of any thinking going on inside it

User avatar
HansV
Administrator
Posts: 78241
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: ntext size

Post by HansV »

An ntext field holds a 16 byte pointer to the location of the value (which is stored outside the table itself).
The maximum length of the value is 230-1 = 1,073,741,823 (Unicode) characters.
Best wishes,
Hans

User avatar
Jezza
5StarLounger
Posts: 847
Joined: 24 Jan 2010, 06:35
Location: A Magic Forest in Deepest, Darkest, Kent

Re: ntext size

Post by Jezza »

Oh I see and now I understand why the data wasn't being displayed correctly....and with your reference to "(which is stored outside the table itself)" I can now further understand the table schema....thanks, this particular database is like an onion where I keep pulling a new layer off :hairout:
Jerry
I’ll be more enthusiastic about encouraging thinking outside the box when there’s evidence of any thinking going on inside it