 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Oscar Espinosa (Egaraset, Guest
|
Posted: Tue Sep 16, 2003 9:58 am Post subject: field length in syscolumns table |
|
|
Hello,
I'm executing a query to syscolumns table to retrieve the size of the fields
of a table... Everything runs ok except when type is nvarchar, when the
length field is the double of the real size. I've noticed that there's a
field called prec that has the correct value. It's possible that when a
field is nvarchar the length field is double than the real size? Can I
consider that to divide it by two when I have the result or I've to retrieve
prec field in this case? It happens with other field type?
thanks very much
--
Oscar Espinosa
|
|
| Back to top |
|
 |
Martijn Tonies Guest
|
Posted: Tue Sep 16, 2003 1:13 pm Post subject: Re: field length in syscolumns table |
|
|
Hi Oscar,
| Quote: |
I'm executing a query to syscolumns table to retrieve the size of the fields
|
I assume you are talking about MS SQL Server here?
| Quote: | of a table... Everything runs ok except when type is nvarchar, when the
length field is the double of the real size. I've noticed that there's a
field called prec that has the correct value. It's possible that when a
field is nvarchar the length field is double than the real size? Can I
consider that to divide it by two when I have the result or I've to retrieve
prec field in this case? It happens with other field type?
thanks very much
|
The "prec" column holds the length in characters, while the "length" column
holds the length in bytes.
Nchars occupy two bytes/character, as documented in the BOL.
--
With regards,
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird & MS SQL Server.
Upscene Productions
http://www.upscene.com
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|