|
Posted by Neil on 05/17/06 19:44
Just curious: why nvarchar instead of varchar?
"Tony Rogerson" <tonyrogerson@sqlserverfaq.com> wrote in message
news:e4fa0l$327$1$8300dec7@news.demon.co.uk...
> If you are just storing the description, eg...
>
> mm
> seconds
> n-page
>
> then I'd hold them using nvarchar and size it according to the maxium
> length you expect, if its just the above then nvarchar(7).
>
> If you are talking about the units themselves then i'd go down this
> route....
>
> create table unit_type (
> id int not null identity constraint sk_unit_type unique
> clustered,
> name nvarchar(7) not null constraint pk_unit_type primary key
> nonclustered
> )
>
> create table measurement (
> unit_type_id int not null references unit_type( id ),
> unit decimal( 10, 5 ) not null
> )
>
> Hope that helps.
>
> Tony.
>
> --
> Tony Rogerson
> SQL Server MVP
> http://sqlblogcasts.com/blogs/tonyrogerson - technical commentary from a
> SQL Server Consultant
> http://sqlserverfaq.com - free video tutorials
>
>
> "John Kevien" <kevien-2002@163.com> wrote in message
> news:mJBag.1$RV2.122@news.uswest.net...
>>
>> hello !
>>
>> I got some problems here. I have an attribute that determines the unit
>> of something,e.g. the size of using "mm" , the length of using "seconds"
>> and something others may using "n-page", so ,which data type should I
>> use. the "nvarchar" or others?
>>
>>
>> thank you very much!
>>
>>
>>
>> *** Sent via Developersdex http://www.developersdex.com ***
>
>
Navigation:
[Reply to this message]
|