Skip to main content
Inspiring
September 4, 2007
Question

SQL Server - Column Length

  • September 4, 2007
  • 2 replies
  • 421 views
Hi,

When creating a table, and specifying the length of the datatype. Is this determined by the number of charactors or size in bytes?

Is there anyway to configure it to determine the size by bytes?

Thanks
This topic has been closed for replies.

2 replies

MattasticAuthor
Inspiring
September 4, 2007
Thanks for your reply.

I dont quite understand that, could you please explain a bit more?

So If I used the ntext datatype it would store the data by memory taken up? Other wise it stores the data using charator length?
Participating Frequently
September 4, 2007
From BOL....

ntext

Variable-length Unicode data with a maximum length of 230 - 1 (1,073,741,823) characters. Storage size, in bytes, is two times the number of characters entered.


Phil
September 4, 2007
For string data, it's bytes. For the various numeric types, the length is defined by the numeric type (tinyint, int, float, etc.)